Attached LDR test since I understood that you wanted it with arduino 1 I did it with LDMicro, I made you an example of how to control it. I did it with internal relays in the exception of the duty_cicle, with this and your part of intelligence you will get to do great things ..
You have to keep in mind that it works with analogs from 0 to 1023, which is the range if you have a 5v pic 0 = 0V output if you place 511 = 2.5V 1023 = 5v output
Adjunto prueba de LDR ya que entendí que lo querías con arduino 1 te lo hice con LDMicro, te hice un ejemplo de como controlarlo. te lo hice con reles internos en la excepción del duty_cicle, con esto y tu parte de inteligencia llegaras ha hacer grandes cosas..
Mon May 24 2021, 12:08:30, download attachment Prueva LDR.ld
(no subject)(by Toni)
Perfect is what I was looking for, thank you very much.