![]() |
Use both joysticks to drive robot on Xbox controller?
How can I use both thumb sticks on an Xbox controller to move the robot's left and right motors?
|
Re: Use both joysticks to drive robot on Xbox controller?
Code:
robotDrive.tankDrive(xboxController.getRawAxis(1), xboxController.getRawAxis(3)) |
Re: Use both joysticks to drive robot on Xbox controller?
You can also try this:
Code:
robotDrive.tankDrive(xboxController.getY(Hand.kLeft), xboxController.getY(Hand.kRight)); |
Re: Use both joysticks to drive robot on Xbox controller?
What we did was define two variables as joysticks on the same port
From there use the Joystick.setChannel() method to change it to the y axis on the other stick. It should be channel 5. after that it should work. |
Re: Use both joysticks to drive robot on Xbox controller?
Quote:
Quote:
Can you post your code please? |
Re: Use both joysticks to drive robot on Xbox controller?
What 18gillespiery recommends is below. I do not recommend teams do this. Instead use either of the examples above.
Once again, this code is not recommended! Code:
public class Robot extends IterativeRobot { |
Re: Use both joysticks to drive robot on Xbox controller?
Okay, thank you all for your help!
|
| All times are GMT -5. The time now is 12:34. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi