shdowmyst

Untitled

Aug 7th, 2016
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. void ChangePalettePeriodically()
  2. {
  3.   uint8_t secondHand = (millis() / 1000) % 60;  //számláló másodpercenként 0-59 között.
  4.   static uint8_t lastSecond = 99;
  5.     if( lastSecond != secondHand) {             //Jól sejtem hogy ez a 2 sor annyit csinál hogy csak
  6.     lastSecond = secondHand;                    //Másodpercenként engedi lefutni az if utáni részeket?
  7.        
  8.     if( secondHand ==  0)  { targetPalette = Blue_Green_gp; }
  9.     if( secondHand == 20)  { targetPalette = Deep_Sea_gp; }
  10.     if( secondHand == 40)  { targetPalette = Incandescent_gp; }
  11.     if( secondHand == 60)  { targetPalette = Purples_gp; }
  12.   }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment