Hi guys
What is the best not blocking way to detect a 3 pushes of a button. I am thinking this:
Any flaws? or any better way to do it? Thanks guys
What is the best not blocking way to detect a 3 pushes of a button. I am thinking this:
Code:
uint16_t timeArray[3];
btnThreePush()
{
if (btnRead()) timeArray[i++] = ticksNow;
}
// main loop
while(1)
{
diff = getDifferent(timeArray);
if (diff > some_time)
{
// do something with 3 push
}
}