#include <Adafruit_NeoPixel.h>
int NeoPixel_PIN = 12;
int Number_of_LEDs = 32;
Adafruit_NeoPixel Strip = Adafruit_NeoPixel(Number_of_LEDs, NeoPixel_PIN);
void setup(){
Strip.begin();
Serial.begin(9600);
}
void loop(){
colorFunctionOne();
colorFunctionTwo();
}
int colorFunctionOne(){
for(int i=0; i<Number_of_LEDs; i++){
if(i<=8){
Serial.print("Blue");
Strip.setPixelColor(i, Strip.Color(0, 0, 255));
Strip.show();
delay(100);
}
else if(i>8 && i<=20){
Serial.print("Green");
Strip.setPixelColor(i, Strip.Color(0, 255, 0));
Strip.show();
delay(100);
}
else{
Serial.print("Red");
Strip.setPixelColor(i, Strip.Color(255, 0, 0));
Strip.show();
delay(100);
}
}
}
int colorFunctionTwo(){
for(int i=0; i<Number_of_LEDs; i++){
if(i<=8){
Serial.print("Navy");
Strip.setPixelColor(i, Strip.Color(0, 0, 102));
Strip.show();
delay(100);
}
else if(i>8 && i<=20){
Serial.print("Yellow");
Strip.setPixelColor(i, Strip.Color(255, 255, 0));
Strip.show();
delay(100);
}
else{
Serial.print("Pink");
Strip.setPixelColor(i, Strip.Color(255, 51, 153));
Strip.show();
delay(100);
}
}
}