Subversion Repositories Projects

Rev

Rev 1755 | 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:
----------------------------------------------
LED Läuft spiralförmig nach aussen
----------------------------------------------

Command / Befehl:
----------------------------------------------
spiral( r, g, b, wait);
----------------------------------------------


Code:
----------------------------------------------
void spiral( uint8_t r, uint8_t g, uint8_t b, uint8_t wait) { 
  uint8_t ri1, ri2, ri3, ri4, ri5, ri6, ri7, ri8;
  
  for (uint8_t j=0; j< riggerSize ; j++){
     for (uint8_t i=1; i<= rigger ; i++){
        if (i == 1){
        strip.setPixelColor(j, r, g, b, 1, 0, 0, 0, 0, 0, 0, 0);
        strip.show();
        delay ( wait );
        strip.setPixelColor(j, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
        strip.show();
        delay ( wait );
        }
        
        if (i == 2){
        strip.setPixelColor(j, r, g, b, 0, 1, 0, 0, 0, 0, 0, 0);
        strip.show();
        delay ( wait );
        strip.setPixelColor(j, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0);
        strip.show();
        delay ( wait );
        }
        
        if (i == 3){
        strip.setPixelColor(j, r, g, b, 0, 0, 1, 0, 0, 0, 0, 0);
        strip.show();
        delay ( wait );
        strip.setPixelColor(j, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0);
        strip.show();
        delay ( wait );
        }
        
        if (i == 4){
        strip.setPixelColor(j, r, g, b, 0, 0, 0, 1, 0, 0, 0, 0);
        strip.show();
        delay ( wait );
        strip.setPixelColor(j, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0);
        strip.show();
        delay ( wait );
        }
        
        if (i == 5){
        strip.setPixelColor(j, r, g, b, 0, 0, 0, 0, 1, 0, 0, 0);
        strip.show();
        delay ( wait );
        strip.setPixelColor(j, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0);
        strip.show();
        delay ( wait );
        }
        
        if (i == 6){
        strip.setPixelColor(j, r, g, b, 0, 0, 0, 0, 0, 1, 0, 0);
        strip.show();
        delay ( wait );
        strip.setPixelColor(j, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0);
        strip.show();
        delay ( wait );
        }
        
        if (i == 7){
        strip.setPixelColor(j, r, g, b, 0, 0, 0, 0, 0, 0, 1, 0);
        strip.show();
        delay ( wait );
        strip.setPixelColor(j, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0);
        strip.show();
        delay ( wait );
        }
        
         if (i == 8){
        strip.setPixelColor(j, r, g, b, 0, 0, 0, 0, 0, 0, 0, 1);
        strip.show();
        delay ( wait );
        strip.setPixelColor(j, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1);
        strip.show();
        delay ( wait );
         }
     }
  }
}
----------------------------------------------