Back to Parent

#include <neopixel.h>

// IMPORTANT: Set pixel COUNT, PIN and TYPE
#define PIXEL_PIN D2
#define PIXEL_COUNT 16
#define PIXEL_TYPE WS2812
 
Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);

void setup() {
    strip.begin();
    
    uint32_t c = strip.Color(0, 0, 255); // Add a color
    for( int i = 0; i < strip.numPixels(); i++ ){
        strip.setPixelColor(i, c); // set a color 
    }
    
    strip.show(); // set updates to the strip
    delay(100);
}

void loop() {

}
Click to Expand

Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0