FRC1076 / 2019-Competition

Code for 2019 Competition
2 stars 1 forks source link

Fix ElevatorAttendant so it detects button-press (when it goes down) #72

Open mcolinj opened 5 years ago

mcolinj commented 5 years ago

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.

mcolinj commented 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()