Skip to content

j-bellavance/EdgeDebounceLite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EdgeDebounceLite

Just replace digitalRead(myPin); with debounce.pin(myPin);

EdgeDebounceLite is a lightweight (26 bytes of RAM) yet capable switch debouncer and EMF filter. It is also very fast. It can confirm that a switch is not bouncing within 90 microseconds, and return at most 180 microseconds after bouncing or EMF disturbances end.

It can debounce any/all pins of any/all arduinos, with just one instance. There no need to create an instance of the debouncer for each switch you need to use.

The algorithm was inpired by an article that can be found at: http://www.ganssle.com/debouncing.htm

Step 1 : Read the pin 16 times;

Step 2 : If all the reads are identical return what has been read;

Step 3 : If not, go back to step 1.

The number of times the pin is read in step 1 can be adjusted between 1 and 32.

About

Just replace digitalRead() with debounce.pin()

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages