|
Re: Joy2 Wheel use as switch
Posted by Nate Smith at 2/18/2001 3:20 PM EST
Other on team #66, Frostbite, from Willow Run High School and GM Powertrain.
In Reply to: Joy2 Wheel use as switch
Posted by Vicente Gonzales on 2/18/2001 2:28 PM EST:
: I am trying to use the wheel off of joystick 2 as a relay output to a spike to control a cylinder. I've tried to change the program, but have been unsuccessful. Does anyone know where I can get some info on how to change a PWM input (from the wheel, in my case) to a relay output?
: Thanks in advance for any help.
Try this...
1. First, use the debug statement in your program to get the values for the positions that you want to use, just in case that the max and min values are not quite 0 and 254.
2. Then, put code similar to this in your program
(note: this code assumes relay 3)
relay3_fwd = 0
relay3_rev = 0
if p2_wheel = 0 then relay_3_reverse
if p2_wheel = 254 then relay_3_forward
; turn off relay 3
goto relay_3_done
relay_3_reverse:
relay3_rev = 1
goto relay_3_done
relay_3_forward:
relay3_fwd = 1
relay_3_done:
Try that out and feel free to ask if you have any questions...
Nate
__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
|