shdowmyst

Untitled

Aug 10th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. void ChangePalettePeriodically()
  2. {
  3. uint8_t Seconds = (millis() / 1000) % (palette_delay + 1);
  4. const bool ActivePalettes[6] = {true, true, true, true, true, true};
  5. const PROGMEM TProgmemRGBGradientPalettePtr ColorPalettes[6] = {test_pl_r, test_pl_g, test_pl_b, test_pl_r, test_pl_g, test_pl_b};
  6. static uint8_t PaletteCounter = 0;
  7.         PaletteCounter %= 6;
  8.  
  9.   if( Seconds == palette_delay)  {
  10.   while (ActivePalettes[PaletteCounter] == false)
  11.       {PaletteCounter++;}
  12.       currentPalette = ColorPalettes[PaletteCounter]; PaletteCounter++;}
  13.   }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment