|
use the wheel as a throttle
Posted by Joe Johnson at 2/6/2001 1:37 PM EST
Engineer on team #47, Chief Delphi, from Pontiac Central High School and Delphi Automotive Systems.
In Reply to: Re: software software software
Posted by Matt Leese on 2/6/2001 9:27 AM EST:
We often use the wheel on the joystick as a variable throttle for the driver joystick(s).
This allows us to have a "training" speed and a competition speed.
The code is not difficult, something along the lines of:
if y1>127 then aaa
pwm1 = 127 - ((127-y1) / NCD (wheel1 + 1) Max 127)
goto bbb
aaa:
pwm1 = 127 + ((y1-127) / NCD (wheel1 + 1)) Max 254
bbb:
As a side benefit, we can dial down the throttle when we go for a show where a bunch of 3rd graders are going to be driving our robot.
Joe J.
P.S. I just wrote that code from memory on the spot, it may not be exactly correct though I believe the concept is substantially correct. JJ
__________________
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.
|