Thread: Java coding
View Single Post
  #5   Spotlight this post!  
Unread 02-03-2012, 07:34
dbeckwith's Avatar
dbeckwith dbeckwith is offline
Lead Programmer
AKA: Daniel Beckwith
FRC #3205 (The Patriots)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: USA
Posts: 84
dbeckwith is an unknown quantity at this point
Re: Java coding

I see a big problem with this. operatorControl() is only called once, not continuously, so you need to put all your drive code and whatnot in that method in a loop so it will run more than just once. Alternatively you could use the IterativeRobot template, which calls its method periodically so you don't need a loop.

Quote:
Originally Posted by Team1605 View Post
Joystick stickDriverLeft = new Joystick(1);
Joystick stickDriverRight = new Joystick(2);
Joystick trigger = new Joystick (3);
Joystick button = new Joystick (4);
You should only make Joystick objects for actual joysticks. To get the trigger and buttons, you would get them from whichever joystick they're on. For example, if they were on the left joystick, you would use stickDriverLeft.getTrigger() (or stickDriverLeft.getRawButton(1)) for the trigger and stickDriverLeft.getRawButton(number) for other buttons.

Also I think you should get rid of the delay in autonomous, it's not helping anything and could actually slow you down.
__________________
q = (2*b) | ~(2*b);

if (life.getLemons() != null) this.lemonade = new Drink(life.getLemons());
else throw new NoLemonsException("What now?");