I am working on a project that senses when a person enters a room, and then switch ON the light in the room and then switch it OFF when the person leaves.
I want to use two PIR motion sensors, one outside the room and the other inside such that when the outside sensor is triggered before the inside sensor, then the microcontroller will switch ON the light and if the inside sensor is triggered before the outside sensor then the light will be switched OFF.
I also want to count the number of persons that go into the room so that the light will only switch OFF when all the persons that entered the room has left.
I am using two buttons to mimick the two sensors in proteus and I am using mikroC compiler.
please I need help on the code that will perform this task. I'll be very grateful.
I want to use two PIR motion sensors, one outside the room and the other inside such that when the outside sensor is triggered before the inside sensor, then the microcontroller will switch ON the light and if the inside sensor is triggered before the outside sensor then the light will be switched OFF.
I also want to count the number of persons that go into the room so that the light will only switch OFF when all the persons that entered the room has left.
I am using two buttons to mimick the two sensors in proteus and I am using mikroC compiler.
please I need help on the code that will perform this task. I'll be very grateful.