Thread: another newbie
View Single Post
  #9   Spotlight this post!  
Unread 05-07-2004, 17:12
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: another newbie

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.
    }
}
__________________


Last edited by Ryan M. : 05-07-2004 at 17:15.