When using joysticks, I generally use the Joystick#getRawButton() method as opposed to the specialized methods. You might want to try using:
Code:
...
if (driveStick.getRawButton(1)) // '== true' is not necessary in an if statement for a boolean
{
...
You can use System.out.println() statements inside the if statement to help you track down the issue. That will show you if the issue is the Joystick button or the solenoid code.
You may have already done this, but you should check the lights on top of the solenoid module while the code runs to ensure that you indeed have a code issue.
Quote:
|
Originally Posted by tStano
It appears that you have not initialized your button. You initialized the joystick but you need to initialize the button as well. Thats my best guess.
|
Correct me if I'm wrong, but the Trigger and Button classes are for use with the Command Based robot patern. OP is using SimpleRobot as the base class, and thus shouldn't be using Buttons or Triggers.
(Protip: if you wrap your code in [code][/code] tags, it will format nicer.)