#include <FastLED.h>
CRGB leds[1];
int ldr = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
FastLED.addLeds<NEOPIXEL, 3>(leds,1);
}
void loop() {
// put your main code here, to run repeatedly:
ldr = analogRead(A0);
Serial.print("Value: ");
Serial.println(ldr);
if (ldr > 1000){
Serial.println("red");
leds[0] = CRGB::Red;
FastLED.show();
}
else if (ldr > 500){
Serial.println("yellow");
leds[0] = CRGB::Yellow;
FastLED.show();
}
else{
Serial.println("green");
leds[0] = CRGB::Green;
FastLED.show();
}
}