I’m fairly new to using the Arduino and my first big project is getting an led to turn on if an IR distance sensor detects motion AND the photo sensor reads low light.
Now I have all this working but I saw online where someone had an led increase and decrease brightness depending on how bright or dark the ambient light is. I also have this working.
My problem is I want to add these two together. In the “if” statement I want to say (roughly)
if the there motion and light is below X, turn on the led in proportion to how dark.
I hope I’ve explained this clearly.
I’ve attached pics of the code to show you what I have at the moment. If you have any tips on how I can get this to work, I would be very grateful.