Subversion Repositories Projects

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

Light Sequence Template:

Created by / Erstellt von:  "Magomora"

Explanation / Erklärung:
----------------------------------------------
Fade in LED color out
----------------------------------------------

Command / Befehl:
----------------------------------------------
fadeout(r, g, b, dly, ri1, ri2, ri3, ri4, ri5, ri6, ri7, ri8)
----------------------------------------------


Code:
----------------------------------------------
void fadeout(uint8_t r, uint8_t g, uint8_t b, uint8_t wait, uint8_t ri1, uint8_t ri2, uint8_t ri3, uint8_t ri4, uint8_t ri5, uint8_t ri6, uint8_t ri7, uint8_t ri8) { 

 uint8_t r2, g2, b2;

for (uint8_t j = 10; j < 127; j++){
  uint8_t rh = r-(j*r/127);
   if((r || 0) && rh < r) r2 = rh;
   if(r == 0) r2 = 0;
  uint8_t gh = g-(j*g/127);
   if((g || 0) && gh < g) g2 = gh;
   if(g == 0) g2 = 0;
  uint8_t bh = b-(j*b/127);
   if((b || 0) && bh < b) b2 = bh;
   if(b == 0) b2 = 0;
for(int i=0; i<riggerSize; i++) {
 strip.setPixelColor(i, r2, g2, b2,ri1, ri2, ri3, ri4, ri5, ri6, ri7, ri8);
 }  
  strip.show();
  delay(wait);
 }
for(int i=0; i<riggerSize; i++) {
 strip.setPixelColor(i, 0,ri1, ri2, ri3, ri4, ri5, ri6, ri7, ri8);
 }  
}
----------------------------------------------