2 #include <util/delay.h>
3 #include <avr/interrupt.h>
10 unsigned char type : 4;
11 unsigned char order : 4;
14 pixel_t pixels[STRIP_SIZE];
19 unsigned char i, start, rgb, jiffies;
27 for (i = 0; i < STRIP_SIZE; i+= 23)
32 if ((jiffies & 7) == 0) {
33 pixels[start].type = 1;
34 pixels[start].order = 14;
37 if ((jiffies & 7) == 3) {
38 pixels[start].type = 2;
39 pixels[start].order = 0;
44 if (start >= STRIP_SIZE)
47 for (i = 0; i < STRIP_SIZE; i++) {
48 unsigned char type = pixels[i].type;
49 unsigned char order = pixels[i].order;
62 pixels[i].type = type == 3 ? 2 : 0;;
64 pixels[i-1].type = pixels[i-1].type == 2 ? 3 : 1;
65 pixels[i-1].order = order-1;
70 send_rgb(1 << ((15-order) / 2), 0, 0);
72 send_rgb(1 << (order/2), 0, 0);
76 pixels[i].order = order;