#define LED 13
#define LDR A0
#include <Servo.h>
void setup()
{
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(LED, OUTPUT);
pinMode(LDR, INPUT);
}
void loop()
{
// put your main code here, to run repeatedly:
int LDR_value = analogRead(A0);
Serial.println(LDR_value);
delay(100);
if(LDR_value>=300)
{ digitalWrite(LED, HIGH);
Serial.println("LDR is Dark, LED is ON");
}
else
{ digitalWrite(LED, LOW);
Serial.println("There is Light Outside");
}
}