Quote:
Originally Posted by notmattlythgoe
Change this line:
Code:
myRobot.tankDrive(stick1,stick2);
to this:
Code:
myRobot.tankDrive(stick1.getY() * 0.5, stick2.getY() * 0.5);
Then change the 0.5 to some scalar value depending on how much you want to scale it.
|
If your joystick has a throttle (any knob/lever that can be set and will stay at a value), you can read that value for the 0.5's above. A bit of math may be required-- the Extreme 3d our team uses goes -1 at the up position (what we think of as full throttle) and +1 at the bottom end so we use
double throttle=(-1*stick.getThrottle() + 1)/2;
This gives us a value between 0 and 1 depending on where the throttle is.
Depending on your stick, you may need to call getZ or some other mapping if you have a throttle. I can't say for sure-- we've only used the one joystick with this year's software.