|
Re: Pnuematics Toggle Code Issue
My team has just switched over to Java from C++ this year, so I'm a little unsure of myself, but I think I know what your issue is. Using whileActive to toggle your solenoid will result in the toggleSolenoid() function running repeatedly as long as the button is held (assuming I'm understanding this right). If there's a function you can use that will only run once when the button is pressed instead of whileActive, that would be best. Otherwise, you can look into using a timer to run the function at most once every half second or so, which would keep it from freaking out.
__________________
FRC Team #706 CYBERHAWKS:
2014 - Programmer:
Lake Superior - Finalist (with teams 3313 and 3883) and Industrial Design Award
Wisconsin - Finalist (with teams 3018 and 1259) and Quality Award
2015 - Programmer:
Wisconsin - Quality Award
Queen City - Creativity Award
Tesla Division
2015-2017 - Programming Mentor for FTC Team #9956 The Knack
2016 - Scouting Co-Leader:
Buckeye - Finalist (with teams 27, 379, and 1014)
Wisconsin - Finalist (with teams 5903 and 537), Excellence in Engineering Award, and Industrial Safety Award
2016-2017 - ???
|