Guest User

Untitled

a guest
Oct 2nd, 2014
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. void ChangePalettePeriodically()
  2. {
  3. uint8_t secondHand = (millis() / 1000) % 60;
  4. static uint8_t lastSecond = 99;
  5.  
  6. if( lastSecond != secondHand) {
  7. lastSecond = secondHand;
  8. if( secondHand == 0) { currentPalette = RainbowColors_p; currentBlending = BLEND; }
  9. if( secondHand == 10) { currentPalette = RainbowStripeColors_p; currentBlending = NOBLEND; }
  10. if( secondHand == 15) { currentPalette = RainbowStripeColors_p; currentBlending = BLEND; }
  11. if( secondHand == 20) { SetupPurpleAndGreenPalette(); currentBlending = BLEND; }
  12. if( secondHand == 25) { SetupTotallyRandomPalette(); currentBlending = BLEND; }
  13. if( secondHand == 30) { SetupBlackAndWhiteStripedPalette(); currentBlending = NOBLEND; }
  14. if( secondHand == 35) { SetupBlackAndWhiteStripedPalette(); currentBlending = BLEND; }
  15. if( secondHand == 40) { currentPalette = CloudColors_p; currentBlending = BLEND; }
  16. if( secondHand == 45) { currentPalette = PartyColors_p; currentBlending = BLEND; }
  17. if( secondHand == 50) { currentPalette = myRedWhiteBluePalette_p; currentBlending = NOBLEND; }
  18. if( secondHand == 55) { currentPalette = myRedWhiteBluePalette_p; currentBlending = BLEND; }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment