Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   joystick java program (http://www.chiefdelphi.com/forums/showthread.php?t=101254)

nuru 26-01-2012 23:25

joystick java program
 
We are a rookie team and are new to Java programming. Could anyone
tell us how to code, compile and run the program to make the
joystick functional?

Thanks a lot.

otherguy 26-01-2012 23:37

Re: joystick java program
 
This line goes where you declare the variables for your class
Code:

Joystick joy1;
This line goes in your initialization method
Code:

joy1 = new Joystick(1); //where 1 is the USB port the joystick is plugged into
Then in teleop, you use methods from the Joystick Class to get data from the joysticks.

like...
Code:

double axis1 = joy1.getRawAxis(1); // get the value from 1.0 to -1.0 off of axis 1;
leftMotor.set(axis1); //where leftMotor is some variable which talks to a motor controller



All times are GMT -5. The time now is 22:22.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi