View Single Post
  #6   Spotlight this post!  
Unread 15-01-2017, 23:48
AustinShalit's Avatar
AustinShalit AustinShalit is offline
Registered User
AKA: אוסטין
no team (WPILib Suite Developer)
 
Join Date: Dec 2013
Rookie Year: 2008
Location: Los Angeles/Worcester/Israel
Posts: 150
AustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of light
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 {
	
	private RobotDrive drive;
	
	private Joystick joystick1;
	private Joystick joystick2;
	
	@Override
	public void robotInit() {
		drive = new RobotDrive(0, 1);
		
		joystick1 = new Joystick(0);
		joystick2 = new Joystick(0);
		
		joystick2.setAxisChannel(AxisType.kY, 5);
	}
	
	@Override
	public void teleopPeriodic() {
		drive.tankDrive(joystick1, joystick2);
	}

}
__________________

Last edited by AustinShalit : 15-01-2017 at 23:52.
Reply With Quote