Go to Post In racing, speed is measured in cubic dollars. In FIRST, success is measured in cubic skill. - Billfred [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 26-01-2012, 23:25
nuru nuru is offline
Registered User
FRC #4404
 
Join Date: Jan 2012
Location: missouri
Posts: 4
nuru is an unknown quantity at this point
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.
Reply With Quote
  #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: 430
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
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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