I would like to control garden lamps with ldr sensor and arduino. Lamps should turn on after it is getting dark. After some time it should turn of despite it is still dark outside. It should start on again after that when it becomes dark again.
How I could improve this code
sensorValue = analogRead(sensorPin);
if (sensorValue < 100)