|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#2
|
|||||
|
|||||
|
Re: pneumatics and joysticks
Quote:
Code:
if (p3_y > 132) {
relay1_fwd = 1;
relay1_rev = 0;
relay2_fwd = 1;
relay2_rev = 0;
}
if (p3_x > 132) {
relay1_fwd = 1;
relay1_rev = 0;
}
)[edit] Aww, what the heck. I'll give you a few more details for free. 1) This code could be added to Default_Routine() in user_routines.c. You would probably also want to remove any other code in Default_Routine() that has anything to do with these joystick axes and relays. 2) I don't know whether you are planning on ever having to retract the cylinders. You said you wanted to "fire" (extend?) two cylinders when the joystick is forward. If, for instance, you want to retract the same two cylinders when the joystick is pulled backwards, you will also need something like: Code:
if (p3_y < 122) {
relay1_fwd = 0;
relay1_rev = 1;
relay2_fwd = 0;
relay2_rev = 1;
}
) because the joystick is not perfectly centered.4) The last time I checked (last year with the old OIs) the joystick X axis increases to the left, and decreases to the right. That is why I tested for p3_x > 132, and not less than 122. [/edit] Last edited by Greg Ross : 24-02-2004 at 18:24. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|