Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Adafruit_NeoPixel.h>
- #define PIN 2
- // Parameter 1 = number of pixels in strip
- // Parameter 2 = pin number (most are valid)
- // Parameter 3 = pixel type flags, add together as needed:
- // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
- // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
- Adafruit_NeoPixel strip = Adafruit_NeoPixel(32, PIN, NEO_GRB + NEO_KHZ800);
- int sine[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,}; //these are the pixels in order of animation-- 32 pixels in total
- void setup() {
- strip.begin();
- strip.setBrightness(100); //adjust brightness here
- strip.show(); // Initialize all pixels to 'off'
- }
- void loop() {
- for(int i=0; i<36; i++) {
- strip.setPixelColor(sine[i], strip.Color(255, 140, 0)); //change RGB color value here
- delay(40);
- for (int j=0; j<25; j++){
- strip.setPixelColor(sine[(j+i+4)%36], strip.Color(0, 0, 0));
- }
- strip.show();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment