#include #define PIN 11 Adafruit_NeoPixel strip = Adafruit_NeoPixel(108, PIN, NEO_GRB + NEO_KHZ800); void setup() { strip.begin(); strip.show(); } void loop() { colorWipe(strip.Color(255, 0, 0), 50); colorWipe(strip.Color(0, 255, 0), 50); colorWipe(strip.Color(0, 0, 255), 50); theaterChase(strip.Color(127, 127, 127), 50); theaterChase(strip.Color(127, 0, 0), 50); theaterChase(strip.Color( 0, 0, 127), 50); rainbow(20); rainbowCycle(10); rainbow(10); rainbowCycle(5); theaterChaseRainbow(50); feuerfrei(strip.Color(40,0, 0), strip.Color(0, 0, 255),100,20); } void colorWipe(uint32_t c, uint8_t wait) { for(uint16_t i=0; i= 0) { strip.setPixelColor(e - i, c2); } if (f + i < 54) { strip.setPixelColor(f + i, c2); } if (f - i >= 27) { strip.setPixelColor(f - i, c2); } if (g + i < 81) { strip.setPixelColor(g + i, c2); } if (g - i >= 54) { strip.setPixelColor(g - i, c2); } if (h + i < 108) { strip.setPixelColor(h + i, c2); } if (h - i >= 81) { strip.setPixelColor(h - i, c2); } strip.show(); delay(wait); } } } void nieustraszony(uint32_t c, uint8_t wait){ int val; int val2; int val3; for(uint16_t i=0; i<15; i++) { val = 29-i; val2=30+i; val3=59-i; strip.setPixelColor(i, c); strip.setPixelColor(val, c); strip.setPixelColor(val2, c); strip.setPixelColor(val3, c); for(uint16_t j=0; j<60; j++) { if(i!=j&&j!=val&&j!=val2&&j!=val3){ strip.setPixelColor(j, strip.Color(0,0,0)); } } strip.show(); delay(wait); } for(uint16_t i=15; i>1; i--) { val = 31-i; val2=61-i; val3=28+i; strip.setPixelColor(i, c); strip.setPixelColor(val, c); strip.setPixelColor(val2, c); strip.setPixelColor(val3, c); for(uint16_t j=0; j<60; j++) { if(i!=j&&j!=val&&j!=val2&&j!=val3){ strip.setPixelColor(j, strip.Color(0,0,0)); } } strip.show(); delay(wait); } } // Input a value 0 to 255 to get a color value. // The colours are a transition r - g - b - back to r. uint32_t Wheel(byte WheelPos) { WheelPos = 255 - WheelPos; if(WheelPos < 85) { return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3); } else if(WheelPos < 170) { WheelPos -= 85; return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3); } else { WheelPos -= 170; return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0); } }