#include <FastLED.h>
CGRB leds[1];
int LDR_PIN = A0;
int value=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:
value = analogRead(LDR_PIN);
Serial.println(value);
if(value > 1000){
Serial.println("Red");
leds[0] = CRGB::Red;
FastLED.show();
}else if(value > 500){
Serial.println("Orange");
leds[0] = CRGB::Orange;
FastLED.show();
}else {
Serial.println("Green");
leds[0] = CRGB::Green;
FastLED.show();
}
}
int set_color(uint32_t col){
for(int i=0;i<N_LEDS;i++){
ring.setPixelColor(i,col);
ring.show();
delay(500);
}
}