#define LDR A0
#define LED 10
int data;
void setup()
{
pinMode(LED, OUTPUT);
Serial.begin(9600);
}
void loop()
{
data = analogRead(LDR);
Serial.print("LDR Sensor Data: ");
Serial.println(data);
if(data < 900)
digitalWrite( LED, 1);
else
digitalWrite(LED , 0);
delay(1000);
}