- #include <util/delay.h>
- #include <avr/io.h>
- #include <avr/interrupt.h>
- #include "light_ws2812.h"
- #define NUM_LEDS 60
- struct cRGB leds[NUM_LEDS];
- int main(void)
- {
- int position = 0;
- while(1) {
- // Let one light run from first to last LED
- if (position == 59) {
- position = 0;
- }
- leds[position].r = 255;
- leds[position].g = 0;
- leds[position].b = 0;
- leds[position-1].r = 0;
- leds[position-1].g = 0;
- leds[position-1].b = 0;
- position++;
- _delay_ms(10);
- }
- }