#include <Adafruit_NeoPixel.h>
int s_pin = 9;
int n_leds = 32;
Adafruit_NeoPixel strip = Adafruit_NeoPixel(n_leds, s_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<n_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<n_leds; i++){
if(i<=8){
Serial.println("pink");
strip.setPixelColor(i, strip.Color(255,0,247));
strip.show();
delay(100);
}
else if(i<20 && i>8){
Serial.println("yellow");
strip.setPixelColor(i, strip.Color(255,230,0));
strip.show();
delay(100);
}
else{
Serial.println("seagreen");
strip.setPixelColor(i, strip.Color(0,255,155));
strip.show();
delay(100);
}
}
}