Plan
Board
Made with Fritzing
Code
int pinLDR = A1;
int pinLED = 13;
int valSensor;
void setup()
{
Serial.begin(9600);
}
void loop()
{
valSensor = analogRead(pinLDR);
Serial.println(valSensor);
if (valSensor < 200) {
digitalWrite(pinLED, HIGH);
}
else {
digitalWrite(pinLED, LOW);
}
delay(1000);
}
Download
Fritzing: ldr_led.fzz