View Single Post
  #3   Spotlight this post!  
Unread 17-02-2015, 15:36
BitBlt BitBlt is offline
Registered User
no team
 
Join Date: Jan 2015
Location: Orlando
Posts: 3
BitBlt is an unknown quantity at this point
Re: Robot Code Problem ** Again**

Are you sure your joysticks are setup correctly in the driverstation?
Can you drive the robot with what you expect to be the "drivestick"?

Put a breakpoint in the execute() function of one of your commands. Make sure you do a Debug As to deploy your project. Press the button of the command you have the breakpoint in. Does your breakpoint get hit?

As for your other question about declaring the buttons on separate lines, I saw in another thread that you were not giving a type to each declaration. So you need something like:

Button button1 = new JoystickButton(joystick, 1);
Button button2 = new JoystickButton(joystick, 2);
Button button3 = new JoystickButton(joystick, 3);

And so on.

You have a lot of local variables declared in each function. What happens when a Talon (for example) goes out of scope and is garbage collected?