Quote:
|
Originally Posted by stephenthe1
wow, I feel like I'm talking to myself. um, could you tell me if you see any problems with this code (it fires a piston when the trigger is pressed, or if the aux. button is pressed). what code is used to reference the thumb button on the "side" of the joystick? I tried this code and it wouldn't work for some reason. do I need these extra variables? I wasn't sure if the buttons "remember" that they were pressed. but it shouldn't matter anyways. should I place this code in user_routines_fast(), or user_routines()? thanks for all the help. here's the code I'm having trouble with:
|
You shouldn't need the extra variables.
When pushed the variables are set, when the button is released, the variable is unset.
You do not need to check if it '==1', you can just have it like so:
Code:
//transmission
if (p3_sw_trig)
{
relay1_fwd = 1;
relay1_rev = 0;
}
if (p3_sw_aux2)
{
relay1_fwd = 0;
relay1_rev = 1;
}