View Single Post
  #6   Spotlight this post!  
Unread 25-02-2004, 16:43
JoshJ JoshJ is offline
Registered User
#0316 (LuNaTeCs)
Team Role: College Student
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Salem County
Posts: 44
JoshJ is on a distinguished road
Send a message via AIM to JoshJ
Re: Button Programing

I would do this so your relays dont pulse 40x a second I don't know whose code I just added to tho... sorry

int flag=0;
//...
//Init Relays
relay1_fwd = 1;
relay1_rev = 0;
//...
if (OI_Switch && !flag)
{
relay1_fwd = !relay1_fwd;
relay1_rev = !relay1_rev;
flag=1;
}
if (!OI_Switch)
{
flag=0;
}