Quote:
|
Originally Posted by dumbo
ok here is what I need to do.
this operates a camera using a pir motion.
when the pir is tripped it has a output for 4sec. (adjustable)
what I need to do is
when the pir trips I need
1 output to stay on for 20sec (adjustable) from the time the pir trips then off
1 output to turn on 4 sec. (adjustable) after the pir trips and stay on for 4sec. (adjustable).then off.
if the pir trips again dearing this cycle. it has no effect.

|
I don't know exactly what you are using to do this/what language you are using/etc, but the basic logic for this would look something like this:
Code:
Loop forever
Check if pir tripped
If it was, then
Turn Output on and wait 20sec
Turn Output on and wait 4sec
End of tripped situation
End check
End of loop
The 20 and 4 could be variables which are settable in some way.
That help?
==EDIT==
Looks like this is in C, so, slightly more detail:
Code:
#define TRIPPED 1 // Whatever the "tripped" setting for the pir reads in the program
while(1)
{
if(pir == TRIPPED)
{
// Turn on outputs and wait approriate times.
// I'm not sure how'd you do this using your specific stuff.
}
}