Go to Post To anyone who is discouraged about their team, don't let yourself get down. I've seen my team go from having a robot that barely moved (and I'm not kidding, we had keys falling out of gearboxes) to this year with a robot that is ACTUALLY GOING TO WORK. Don't lose hope, stick with FIRST! - ZipTie3182 [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Spotlight this post!  
Unread 22-03-2013, 20:13
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 Command not working

Quote:
Construct objects outside of your loop. (in the class)
Code:
public class TankDrive extends Thread {
  Joystick USB1 = new Joystick(1);
  RobotDrive drive = new RobotDrive(2,3,1,4);

  public void run(){
    while(true){
      drive.tankDrive(USB1.getRawAxis(2), USB1.getRawAxis(4));
    }
  }
}
Note, you shouldn't need to command the drivetrain in its own thread though...

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.
__________________
http://team2168.org
Reply With Quote
 


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 11:26.

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