Specifications
17
AVR064
2529A–AVR–11/02
STK500 Switches Figure 14. CheckButtons
There are three switches that are used as inputs to the application. To do several tasks
with only three switches, a menu system is needed. Figure 14 shows three menus in a
hierarchy, which are used in this code. See Figure 2 for the a overview of the menus.
Figure 14 refers to ButtonA/B/C, in the application these buttons can be found at:
“ButtonA” is SW7 which is connected to PE7.
“ButtonB” is SW6 which is connected to PE6.
“ButtonC” is SW5 which is connected to PE5.
Example:
After a RESET the LCD is set up to scroll a text. None of the three menus are active.
Pressing the SW7 will toggle between the alternatives in Menu 1 (Clock, Date, Set point,
Temperature, Offset, and Contrast)
Read
Buttons
Button
A, B, or C?
Yes
Shift
Menu1
Button
A, B, or C?
Menu 2
Active?
No
A
B
Return
No
Yes
Shift
Menu 2
A
Activate
Menu 2
Menu 3
Active?
No
Yes
C
Activate
Menu 3
B
Deactivate
Menu 2
C
Button
A, B, or C?
A
B
C
Increase
Value
Decrease
Value
Deactivate
Menu 3
Return
Buttons
Released from
Last Time?
Run
LCDsetupData
Run
LCDsetupData
Run
LCDsetupData
Return
Return
Return
Return
CheckButtons
Deactivate
Menu 1