We will configure pin 5 of the ESP32 to accept external interrupts here. Luckily for us, any GPIO of the ESP32 can accept external interrupts (unlike other boards like Arduino Uno, which can accept external interrupts on only some specific pins). In this sketch we allow the ISR to be executed only once on each button press, instead of executing it multiple times.Ĭhanges to the sketch are highlighted in green. Button interrupts are technically referred to as external interrupts. Here the above sketch is rewritten to demonstrate how to debounce an interrupt programmatically.
0 Comments
Leave a Reply. |