Ir sensors lights on and off when people forget to do that

We are making a project with IR sensors of lights on and off with Aurdino and we can not code, its kind of overwhelming to do that now since the person who could write programs is sick
so well so can someone pls tell me how to write the source code

It will be really appreciated


Connect the IR sensor to any one of the Digital Pin. In Arduino, store the digitalRead(pin) function to any variable. Later in the program, if the stored variable is ‘HIGH’, write a function digitalWrite(pin, HIGH/LOW).

I provided you with the logic to use. You can find projects on the internet that will provide you with the arduino code. You can refer to for idea of the arduino code.

Do share with us more about the project you’re building and the role of Bolt IoT in it.

Thankyou for your help