int Led = 5;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(Led, OUTPUT);
}
void loop() {
int LDR = analogRead(4);
Serial.println(LDR);
if (LDR < 500 )
digitalWrite(Led, HIGH);
else
digitalWrite( Led, LOW);
delay(1000); // this speeds up the simulation
}