# Leading edge debouncing

**URL:** <https://forum.arduino.cc/t/leading-edge-debouncing/964407>\
**Category:** Programming\
**Created:** [February 28, 2022, 5:43pm UTC](https://forum.arduino.cc/t/leading-edge-debouncing/964407 "2022-02-28T17:43:48Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![DaveX](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/davex/32/751443_2.png) [@DaveX](https://forum.arduino.cc/u/DaveX)\
**Post date:** [March 9, 2022, 9:38pm UTC](https://forum.arduino.cc/t/leading-edge-debouncing/964407/15 "2022-03-09T21:38:53Z")

</div>

It looks like the Bounce2 library has a pre-include define, `#define BOUNCE_LOCK_OUT`, that should enable leading edge debouncing: [GitHub - thomasfredericks/Bounce2: Debouncing library for Arduino and Wiring](https://github.com/thomasfredericks/Bounce2#lock-out-interval)

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/5/2/8/528ee4457e60ae53e204688fa1e52cfc39e54d3a.png)

...but I'm not sure it works. I added it to my demo here, but the performance didn't seem to change relative to the other methods.

> **[LeadingEdgeDebounce.ino - Wokwi Arduino and ESP32 Simulator](https://wokwi.com/projects/324855073217708626)**
>
> Run IoT and embedded projects in your browser: ESP32, Arduino, Pi Pico, and more. No installation required!

Maybe it is because Arduino version is a few versions behind the library at 2.60.0, versus 2.70 on Github?

---

_[View the full topic](https://forum.arduino.cc/t/leading-edge-debouncing/964407)._
