View Single Post
  #1   Spotlight this post!  
Unread 12-02-2014, 00:39
Domenic Rodriguez's Avatar
Domenic Rodriguez Domenic Rodriguez is offline
Registered User
FRC #0316 (LuNaTeCs)
Team Role: College Student
 
Join Date: Sep 2010
Rookie Year: 2011
Location: Grove City, PA
Posts: 213
Domenic Rodriguez has a spectacular aura aboutDomenic Rodriguez has a spectacular aura aboutDomenic Rodriguez has a spectacular aura about
Re: Rookie Java FRC programming buttons

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.)
__________________

LuNaTeCs - Learning Under Nurturing Adults Teaching Engineering Concepts and Skills - Small and Mighty!

FRC 316 LuNaTeCs - Student (2011-2014), Lead Programmer (2011-2014), Team Captain (2013-2014), Operator (2013), Drive Coach (2014), Mentor (2015-????)
'11 Philly Regional Finalists, '13 Chestnut Hill Finalists, '13 Lenape Champions, '13 Archimedes Division, '14 Chestnut Hill Champions, '14 Lenape Champions
FTC 7071 EngiNerds - Founding Advisor (2013-2014) | FRC 5420 Velocity - Founding Advisor (2015)
Grove City College Class of '18, Electrical/Computer Engineering (B.S.E.E)

Reply With Quote