View Single Post
  #4   Spotlight this post!  
Unread 01-02-2007, 11:28
SoD SoD is offline
Registered User
FRC #2230
 
Join Date: Jan 2007
Location: Israel
Posts: 15
SoD is an unknown quantity at this point
Re: Microswitch problem

Darn we now have a new problem

if (rc_dig_in01 == 0)
{
relay1_fwd = 0;
relay1_rev = 0;
}

else
{
relay1_fwd = 1;
relay1_rev = 1 ;
}

This is the code we are trying to use atm, but we have a problem. When the motor works foward, and i press the microswitch, it changes from 1 to 0 and the motor stops working. But when the motor is working backwards, and I press the microswitch, the microswitch turns to 0 but the relay1_rev remains 1 ;s

Whats wrong?