Quote Originally Posted by DDDvvv View Post
hi all
i tried to implement the flag idea, but still the same result.
Hi,

You should understand debouncing NEED time, where ever this time comes from ( capacitor, timer ...)

the idea of debouncing is :

" Does the electrical state of pin still changes afer X milliseconds ??? "

so, you can't get a correct answer before X milliseconds !!! - Obvious -

But 200 ms is debouncing time for really poor quality switches, 20 ms can be obtained easily.

note also switches " bounce " when closing its contact ... not when opening it !!!

so, ... is it here THE good idea ???

Further, May I tell you a real time timer might not be disturbed by a keypress ... - or your program is " not so good " ...

the delay needed by the RTC to be updated is so far smaller than a key press action ...

Alain