13 uint32_t ledColors[LED_COUNT];
19 uint32_t pattern[] = {
28 #define pattern_count (sizeof(pattern) / sizeof(pattern[0]))
31 void alternate(
int count,
int delay);
32 void chase(
int count,
int delay);
57 void alternate(
int count,
int delay)
60 ledColors[0] = COLOR_GREEN;
61 ledColors[1] = COLOR_RED;
62 ledColors[2] = COLOR_RED;
63 ledColors[3] = COLOR_GREEN;
66 while (count < 0 || --count >= 0) {
69 ledColors[0] = ledColors[1];
70 ledColors[1] = ledColors[3];
71 ledColors[2] = ledColors[3];
72 ledColors[3] = ledColors[0];
75 ws2812_set(driver, LED_PIN, ledColors, LED_COUNT);
83 void chase(
int count,
int delay)
89 while (count < 0 || --count >= 0) {
93 for (i = 0; i < LED_COUNT; ++i) {
94 ledColors[i] = pattern[idx];
95 if (++idx >= pattern_count)
98 if (++base >= pattern_count)
102 ws2812_set(driver, LED_PIN, ledColors, LED_COUNT);