Subversion Repositories Projects

Rev

Rev 1790 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1790 Rev 1793
Line 16... Line 16...
16
Code:
16
Code:
17
----------------------------------------------
17
----------------------------------------------
18
void rainbowCycleAll(uint8_t wait, uint8_t cyl, uint8_t ri1, uint8_t ri2, uint8_t ri3, uint8_t ri4, uint8_t ri5, uint8_t ri6, uint8_t ri7, uint8_t ri8) {
18
void rainbowCycleAll(uint8_t wait, uint8_t cyl, uint8_t ri1, uint8_t ri2, uint8_t ri3, uint8_t ri4, uint8_t ri5, uint8_t ri6, uint8_t ri7, uint8_t ri8) {
19
 uint16_t i, j, w;
19
 uint16_t i, j, w;
Line 20... Line 20...
20
 
20
 
21
 for (j=0; j < 384; j++) { // 5 cycles of all 384 colors in the wheel
21
 for (j=0; j < 384*cyl; j++) { // cyl * cycles of all 384 colors in the wheel
22
 for (i=0; i < riggerSize; i++) {
-
 
23
 // tricky math! we use each pixel as a fraction of the full 384-color
-
 
24
 // wheel (thats the i / strip.numPixels() part)
-
 
25
 // Then add in j which makes the colors go around per pixel
-
 
26
 // the % 384 is to make the wheel cycle around
22
 for (i=0; i < riggerSize; i++) {
27
       strip.setPixelColor(i, Wheel(j),ri1, ri2, ri3, ri4, ri5, ri6, ri7, ri8);
23
       strip.setPixelColor(i, Wheel((j) % 384),ri1, ri2, ri3, ri4, ri5, ri6, ri7, ri8);
28
     }
24
     }
29
   strip.show(); // write all the pixels out
25
   strip.show(); // write all the pixels out
30
    for (w=0; w < wait; w++){
26
    for (w=0; w < wait; w++){
31
        delay(5);
27
        delay(5);