Neopixel Strip Code
#include <neopixel.h>
#define PIXEL_PIN D2
#define PIXEL_COUNT 14
#define PIXEL_TYPE WS2812
Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);
void setup() {
strip.begin();
strip.show();
}
void loop() {
for(int i = 0 ; i < strip.numPixels(); i++ ){
if( i % 3 == 0 ){
strip.setPixelColor( i, strip.Color(139,69,19) );
}
else if( i % 3 == 1 ){
strip.setPixelColor( i, strip.Color(0,128,0) );
}
else{
strip.setPixelColor( i, strip.Color(255,192,203) );
}
}
strip.show();
delay(100);
}
Click to Expand
Content Rating
Is this a good/useful/informative piece of content to include in the project? Have your say!
You must login before you can post a comment. .