Open hschilling opened 2 years ago
Storytime: We used a limit switch to reset the encoder value of our elevator. When the elevator came off the limit switch, the switch bounced back, which reset the elevator when it was not at the home position. Then when it tried to move it slammed into the top of its track because it didn't know where it was. One way we fixed this was debouncing.
Video (Middle robot, red alliance): https://www.youtube.com/watch?v=_1gsjjIUMMY&t=6s
In this scenario, the issue is not with the pressing of the limit switch, but the releasing. Which of the three debouncing modes would be best here?
https://docs.wpilib.org/en/stable/docs/software/advanced-controls/filters/debouncer.html
Things to consider: Debouncing adds a small delay between switch press and reaction time. Notice the three debounce modes: