#include <Adafruit_NeoPixel.h>
int pin = 11;
int number_of_leds = 32;
Adafruit_NeoPixel strip = Adafruit_NeoPixel(number_of_leds, pin);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
strip.begin();
}
void loop() {
// put your main code here, to run repeatedly:
colorFunctionOne();
colorFunctionTwo();
}
int colorFunctionOne(){
for(int i=0; i<number_of_leds; i++){
if(i<=8){
Serial.println("Blue");
strip.setPixelColor(i, strip.Color(0,0,255));
strip.show();
delay(100);
}
else if(i<20 && i>8){
Serial.println("Green");
strip.setPixelColor(i, strip.Color(0,255,0));
strip.show();
delay(100);
}
else{
Serial.println("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.println("Purple");
strip.setPixelColor(i, strip.Color(195,177,225));
strip.show();
delay(100);
}
else if(i<20 && i>8){
Serial.println("Yellow");
strip.setPixelColor(i, strip.Color(253,253,150));
strip.show();
delay(100);
}
else{
Serial.println("Red");
strip.setPixelColor(i, strip.Color(255,209,220));
strip.show();
delay(100);
}
}
}