//Coded By: Nitin Rajput
int LDRInput=A0; //Set Analog Input A0 for LDR.
void setup() {
pinMode(LDRInput,INPUT);
pinMode(8,OUTPUT);
}
void loop() {
int value=analogRead(LDRInput); //Reads the Value of LDR(light).
if(value>300)
{
digitalWrite(8,HIGH);
}
else
{
digitalWrite(8,LOW);
}
}