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?