View Single Post
  #2   Spotlight this post!  
Unread 26-01-2012, 23:37
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 431
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
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
__________________
http://team2168.org
Reply With Quote