code of debounce...

I need any code of debounce that works very good, but not the sketch of arduino suggests, It must be different.


Arduino debounce code works fine. It standard code.

Is that any problem u dont want to use it

This macro gives a true value if a rising edge is preceded by 7 intervals of low level.

#define DRE(signal, state) (state=(state<<1)|(signal&1)&255)==1

I haven't seen anything as compact as @Nilton61's before. Am I correct to think it needs to be called 8 times before it returns a value?

You may also like to look at the simple debounce system in several things at a time

And more importantly, do you actually have a debounce problem that needs to be fixed.


yes it has to be called 8 times before it can return 1. But it will return 1 on the first call after a low->high transition of signal so the delay is neglectable.