#define LDRPin A5
#define LED 6
void setup()
{
pinMode(LED, OUTPUT);
Serial.begin(9600);
}
void loop()
{
int ADCvalue=analogRead(LDRPin);
Serial.print("Analog value from LDR is :");
Serial.println(ADCvalue);
digitalWrite(LED,ADCvalue>512?HIGH:LOW);
delay(200);
}