#include <Adafruit_NeoPixel.h>
int Neo = 9;
int ledN = 16;
Adafruit_NeoPixel ring = Adafruit_NeoPixel(ledN, Neo);
int Ldr = A0;
int values = 0;
void setup() {
// put your setup code here, to run once:
ring.begin();
Serial.begin(9600);
}
int Neos(uint32_t color) {
for(int i = 0; i < ledN; i++) {
ring.setPixelColor(i, color);
ring.show();
delay(100);
}
}
void loop() {
// put your main code here, to run repeatedly:
values = analogRead(Ldr);
Serial.println(values);
if(values > 1000){
Serial.println("Red");
Neos(ring.Color(255,0,0));
}
else if(values > 500){
Serial.println("Yellow");
Neos(ring.Color(255,255,0));
}
else {
Serial.println("Green");
Neos(ring.Color(0,255,0));
}
}