View Single Post
  #2   Spotlight this post!  
Unread 01-03-2016, 15:28
Fauge7 Fauge7 is offline
Head programmer
FRC #3019 (firebird robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Scottsdale
Posts: 195
Fauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to all
Re: Java Iterative-Robot: Toggle Buttons?

suggestion #1: dont use iterative, Java is an object oriented programming for what it is meant for, objects!
suggestion #2: post your code so we might be able to help
suggestion #3:look at the code below


here is some example code for suggestion number 1

Code:
boolean buttonToggle = false;
if (button.isPressed()) {
  buttonToggle = !buttonToggle;
}

//code for using it:

if (buttonToggle) {
motor.setSpeed(someSpeed);
}

Last edited by Fauge7 : 01-03-2016 at 15:31.