View Single Post
  #3   Spotlight this post!  
Unread 07-02-2005, 00:44
reilly reilly is offline
Registered User
#0771
 
Join Date: Jan 2005
Location: Brooklyn New York
Posts: 23
reilly is an unknown quantity at this point
Re: Solenoid control

Here is the way to do this:

if (p3_sw_trig) //no semi colons for functions

{
relay3_fwd = 1;
}

else (!p3_sw_trig)

{
relay3_fwd = 0;
}

else if (p3_sw_top) //or if is fine here also

{
relay3_rev = 1;
}

else

{
relay3_rev = 0;
}

Last edited by reilly : 07-02-2005 at 00:47.