Open mcolinj opened 5 years ago
We have functions like this that permit us to detect the "first" time when a button gets pressed. We'll need to be a bit careful using these, since we could have multiple entities checking for the same buttons due to the odd nature of the way we are dealing with the controller. So maybe it will be too tricky to make this work easily in all cases. But, the elevator might be a good place to do it.
getAButton() getAButtonPressed() getAButtonReleased()
Detecting the first time the button goes down permits us to do the expensive one-time kinds of things (like logging, initializing from SmartDashboard. If we can log a message on the first time a button is pressed, we avoid flooding the logs with too much information. You'll need to read about getting buttonDown events from the controllers. I don't think it is too hard.