![]() |
Joystick Command not working
We have recently encountered this problem, our joystick command did not work. We tried Joystick USB1 = new Joystick(1); in our program. In our driver Station under set up it is reading the joysticks as a button press causes the joystick color tab to change in the DS. Has anyone encountered this problem if so how did you fix the problem.
|
Re: Joystick Command not working
What exactly isn't working? What error(s) are you getting?
How are you linking a command to a button press? And where do these calls reside in your code (which method(s)?) Share your code and elaborate. As is you haven't provided enough info for anyone to troubleshoot the problem. |
Re: Joystick Command not working
We are using this code to do the drive on our base robot. It has worked in the past with our actual robot and connected the same way our actual robot is wired. I have uploaded the code to the basebot and it seems to not work. All of our jaguars have a solid light indicating a pwm signal and the joystick does not work on commanding the robot. When ever I connect the joystick the button the joystick color on the setup is different indicating the DS is reading the joystick. Does anyone know any solution?
[public class TankDrive extends Thread { public void run(){ while(true){ Joystick USB1 = new Joystick(1); RobotDrive drive = new RobotDrive(2,3,1,4); drive.tankDrive(USB1.getRawAxis(2), USB1.getRawAxis(4)); } }} ] |
Re: Joystick Command not working
You're creating the Joystick and RobotDrive object once every loop. Construct objects outside of your loop. (in the class)
|
Re: Joystick Command not working
Quote:
Code:
public class TankDrive extends Thread {Also, verify with your controller, but typically the y axis on the right analog stick of a joystick is on axis 5 (you are using 4 above). If you find that the right side of your drivetrain doesn't move as expected, this is likely your problem. |
Re: Joystick Command not working
Quote:
|
Re: Joystick Command not working
Quote:
|
| All times are GMT -5. The time now is 22:33. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi