#include <Adafruit_NeoPixel.h>
int Color[][3] = {
{255, 0, 0},
{0, 255, 0},
{0, 0, 255},
{255, 255, 0},
{255, 0, 255},
{0, 255, 255},
{255, 255, 255},
{128, 128, 128},
{255, 165, 0},
{128, 0, 128},
{165, 42, 42}
};
int i=0;
int r = Color[i][0];
int g = Color[i][1];
int b = Color[i][2];
int pin = 12;
int lednumber = 40;
//Adafruit_NeoPixel ring = Adafruit_NeoPixel(lednumber, pin, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip = Adafruit_NeoPixel(48, 12, NEO_GRB + NEO_KHZ800);
// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino 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_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across
// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input
// and minimize distance between Arduino and first pixel. Avoid connecting
// on a live circuit...if you must, connect GND first.
void setup() {
strip.begin();
strip.show();
}
void loop() {
for(int i=0;i<=40;i++)
{
strip.setPixelColor(i,strip.Color(255,255,255 ));
delay(10);
strip.show();}
for(int i=40;i>=0;i--)
{
strip.setPixelColor(i,strip.Color(218,218,218 ));
delay(10);
strip.show();
}
for(int i=0;i<=40;i++)
{
strip.setPixelColor(i,strip.Color(131, 131, 131 ));
delay(10);
strip.show();}
for(int i=40;i>=0;i--)
{
strip.setPixelColor(i,strip.Color(0, 0, 0 ));
delay(10);
strip.show();}
for(int i=0;i<=40;i++)
{
strip.setPixelColor(i,strip.Color(249, 9, 9 ));
delay(10);
strip.show();
}
for(int i=0;i>=0;i--)
{
strip.setPixelColor(i,strip.Color(34, 11, 234 ));
delay(10);
strip.show();}
for(int i=0;i<=40;i++)
{
strip.setPixelColor(i,strip.Color(242, 250, 3));
delay(10);
strip.show();}
}