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)
pwm1 = 127 + ((y1-127) / NCD (wheel1 + 1)) Max 254
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.
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