We are having a similar problem. We have this basic layout for our shifters and another cylinder:
Quote:
relay2_fwd = 0;
relay2_rev = 0;
if(p4_sw_trig == 1)
{
relay2_fwd=1;
relay2_rev=0;
}
else if (p4_sw_trig == 0)
{
relay2_fwd=0;
relay2_rev=0;
}
|
We are using a button on the control panel to activate it. The problem is that the we have to hold the button to say in high or low gear. I tried to set it so that one press of the button would
activate the cylinder and a second would
deactivate the cylinder. I have tried doing this a couple different ways, but as the code cycles every 20 something milliseconds, the shift state changes with it. So as I press the button quickly, it will activate and deactivate a couple dozen times. How do I stop this? (using MBLAB)