Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void rainbowCyclePlayer1(uint8_t wait)
- {
- int m = 32;
- uint16_t k, j;
- //Turns off player 1 LEDs
- digitalWrite(latch2, LOW);
- shiftOut(data2, clock2, MSBFIRST, 255);
- digitalWrite(latch2, HIGH);
- for (j=0; j < 384 * 3; j++) { // 5 cycles of all 384 colors in the wheel
- for (k=0; k < strip.numPixels(); k++) {
- // tricky math! we use each pixel as a fraction of the full 384-color wheel
- // (thats the i / strip.numPixels() part)
- // Then add in j which makes the colors go around per pixel
- // the % 384 is to make the wheel cycle around
- strip.setPixelColor(k, Wheel( ((k * 384 / strip.numPixels()) + j) % 384) );
- }
- strip.show(); // write all the pixels out
- delay(wait);
- }
- for(m; m >= 0; m--)
- {
- strip.setPixelColor(m, 0);
- strip.show();
- }
- //Turn on player1 LEDs
- digitalWrite(latch2, LOW);
- shiftOut(data2, clock2, MSBFIRST, 0);
- digitalWrite(latch2, HIGH);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement