Quote:
|
Originally Posted by sirbleedsalot
Here is the user rountines file our cylinder is connected to relay 2. please let me know if there is anything else you need.
|
Relay 2 is controlled by the port 2 joystick's trigger and top buttons. Use the Dashboard program to verify that your old joystick is actually working and that the OI is sending the values to the robot.
One other thing:
Code:
if ((((signed int)p1_x-127) && 0x7f) < DEADBAND) p1_x=127;
if ((((signed int)p1_y-127) && 0x7f) < DEADBAND) p1_y=127; /*puts dead band region on joysticks*/
What the heck is this? The comment says you're applying a dead band (defined to 5 early on in the file), but the code does nothing useful. You're turning the 0-254 range into a value between -127 and 127, with zero being neutral, and that's fine. But then you do a logical
and with a nonzero value. That essentially results in a joystick neutral (zero) being returned as false (zero), and anything else is returned as true (one). Both are less than 5, so you're
always setting your joystick values to 127.
I think you want something like this instead:
Code:
if ((127-DEADBAND < p1_x) && (p1_x < 127+DEADBAND)) p1_x=127;
if ((127-DEADBAND < p1_y) && (p1_y < 127+DEADBAND)) p1_y=127;