View Single Post
  #2   Spotlight this post!  
Unread 01-03-2016, 16:26
rrossbach rrossbach is offline
Registered User
AKA: Ron R
FRC #2607 (RoboVikings)
Team Role: Mentor
 
Join Date: Nov 2008
Rookie Year: 2008
Location: Warrington PA
Posts: 90
rrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to behold
Re: Java Iterative-Robot: Toggle Buttons?

Our team developed a short extension of the Joystick class implementing a couple of useful methods for cases like this.

One of those is a "getToggleButton(int buttonNumber)" that you can use just like getRawButton() in Joystick, the difference being that the return value of the method starts off false and alternates between true and false with each press of the button.

The code is up in our github repo, here's a link to the specific class (robovikingStick)

Hope that helps!

- Ron
Team #2607 controls mentor
__________________

FIRST Mid-Atlantic Volunteer
FRC Team #2607 Mentor