#include <FastLED.h>
CRGB leds[1];
int LDR_sensor_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_sensor_pin);
Serial.print("Value : ");
Serial.println(value);
if(value < 500){
Serial.println("Lights have On with Full Brightness");
leds[0] = CRGB(255, 242, 0);
FastLED.show();
}
else if(value > 500 and value < 1000){
Serial.println("Lights have On with Slightly Dim Brightness");
leds[0] = CRGB(242, 255, 0);
FastLED.show();
}
else if(value > 1000){
Serial.println("Lights are off");
leds[0] = CRGB::WhiteSmoke;
FastLED.show();
}
}