Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ChangePalettePeriodically()
- {
- uint8_t Seconds = (millis() / 1000) % (palette_delay + 1);
- const bool ActivePalettes[6] = {true, true, true, true, true, true};
- const PROGMEM TProgmemRGBGradientPalettePtr ColorPalettes[6] = {test_pl_r, test_pl_g, test_pl_b, test_pl_r, test_pl_g, test_pl_b};
- static uint8_t PaletteCounter = 0;
- PaletteCounter %= 6;
- if( Seconds == palette_delay) {
- while (ActivePalettes[PaletteCounter] == false)
- {PaletteCounter++;}
- currentPalette = ColorPalettes[PaletteCounter]; PaletteCounter++;}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment