Datasheet

Jon Waddington
20
3.3 Menu System
A menu is displayed on the television which shows four items for the user to choose
from. Navigation of the menu is done using the Remote control. The up and down arrows
control which item is selected and pressing the “stand-by” button enters the item. The
current time and date is constantly displayed along the top of the menu. Figure 3.3
shows the hierarchy of the Information System’s menus.
The code below shows the “main” method which displays the main menu. This is similar
to how every menu in the program is displayed.
PRI main
{{Method displays Main Menu}}
repeat
rc.flush 'flush RC5
text.out($00) 'clear screen
showdate(0, 0) 'show date and time
showtime(35, 0)
text.str(string(13," Information System")) 'display title
text.str(string(13,13,13," . Home Automation",13,13," .
Temperature",13,13," . X10
Setup",13,13," . Settings")) 'display items
code := 0 'flush code
repeat until (code == enter) 'repeat until enter is pressed
case sel 'case statement displays cursor on items
0 : text.str(string($0A,7,$0B,5,"> "))
text.str(string($0A,7,$0B,7,"2."))
text.str(string($0A,7,$0B,9,"3."))
text.str(string($0A,7,$0B,11,"4. "))
1 : text.str(string($0A,7,$0B,5,"1."))
text.str(string($0A,7,$0B,7,"> "))
text.str(string($0A,7,$0B,9,"3."))
text.str(string($0A,7,$0B,11,"4. "))
Main Menu
Home
Automation
Temperature
X10 Settings
Settings
Figure 3.3. Diagram of the Menu Layout