View Single Post
  #1   Spotlight this post!  
Unread 17-02-2012, 17:15
nubie nubie is offline
Registered User
FRC #2734
 
Join Date: Feb 2012
Location: Illinois
Posts: 4
nubie is an unknown quantity at this point
Can't read joystick values in Java

Our team is trying to implement a simple mecanum drive in Java, but whenever we try to set a motor speed based on a joystick value, the motor simply does nothing. No error is thrown, but it does not spin.

We are extending the SimpleRobot class. We are initializing the joysticks with:

Code:
private Joystick leftStick;

public RobotTemplate() {
leftStick = new Joystick(1);
and then later on...

Code:
drivetrain.tankDrive(leftStick, rightStick);

//or

leftMotor.set(leftStick.getX());
We just switched from C++ to Java and we were able to use the joysticks fine in our C++ program, so we don't think it's a control system issue.

Any help would be greatly appreciated! Thanks.
Reply With Quote