Set Date and Time
Hello everyone,
Im working on a Program that i have written in a StateDiagram way. I have 3 buttons wired to my micro, with a strategy to avoid boucing.
this a part of my program where if the button is PRESSED then we add 1 to the variable "Day". The problem is that because the while(1) loop is very quick, the incrementation is very fast. I have experienced to put a Delay after but this is not precise at all and a too short or to long press on the button would ruin it.
SO, do you have a solution for me that even by pressing longly, the value of Day would not increment more than 1 time ?
I hope ive made myself understandable, im wainting for your suggestion
if(PbState[1] == PRESSED)
{
Day++;
}
