State machine
Dependencies: mbed Adafruit_GFX BioroboticsMotorControl MODSERIAL BioroboticsEMGFilter
Diff: Button.h
- Revision:
- 9:27d00b64076e
- Parent:
- 7:e7f808875bc4
--- a/Button.h Wed Oct 31 06:13:38 2018 +0000 +++ b/Button.h Wed Oct 31 08:17:35 2018 +0000 @@ -34,7 +34,7 @@ bool state = !pin; // Debounce the button by looking over two periods. - if (last_state && state) { + if (last_state && state && !pressed) { pressed = true; just_switched_to_pressed = true; }