Back to Parent

#include "neopixel.h"

#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();
  strip.show(); // Initialize all pixels to 'off'
}



void loop() {

  uint16_t i;

  for(i=0; i< strip.numPixels(); i++) {
    strip.setPixelColor(i, 0,0,255 );//blue
  }
	strip.show();
	delay( 1000 );
	
  for(i=0; i< strip.numPixels(); i++) {
    strip.setPixelColor(i, 255,0,0 );//red
  }
	strip.show();
	delay( 1000 );
	
  for(i=0; i< strip.numPixels(); i++) {
    strip.setPixelColor(i, 0,255,255 );//green
  }
	strip.show();
	delay( 1000 );
	
	
  for(int i=0; i<strip.numPixels(); i++) {
     strip.setPixelColor(i, 255, 255, 255 );//white
  }
     strip.show();
     delay(1000);
  
	

}
Click to Expand

Content Rating

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

0