Can somebody help me!
I want to use PIR as a substitute for light switch!
All I want to do is interface the PIR with a timer! When the sensor detect a person the it will send a signal to timer that will make the ligh on! The reason i want a timer is the light will no immediately turn off when the sensor goes low! Please no program is required!
initialize two interrupt routine 1, External interrupt 2, Timer interrupt
PIR connect to an interrupt Pin
Device connect to GPIO pin
clear timer register ,stop timer ,deactivate the device
wait for interrupt while(1);
1, when External interrupt occur activate light , clear timer register ,start timer finally exit from External interrupt routine.
2, when timer interrupt occur deactivate the device , stop timer finally exit from timer interrupt routine.