|
Answer is yes, you can change time with a button(s). Usually a button for
up, one for down, another for menu select.
1) Buttons would have to be debounced, generally in firmware by polling the
port with the pins in a for() or while() loop.
2) You debounce a button by detecting first closure, then timing out a period, on the order of
100 mS, and checking to see its still closed. If it is and doneflag == 0 then you do the function
assigned to that pin/button and set doneflag==1. Keep in mind you also have to debounce the
button open, and when it is open reset doneflag==0. The 100 mS can be done with a timer or
counter, and an ISR to inc a variable every 100 mS. 100 mS is switch dependent, but should
be OK for most switches.
Some debouce info that may be of help.
Regards, Dana.
|