Datasheet
Jon Waddington
95
if (code == down)
sel := --sel <# 2
code := 0
case sel
0 : sett
1 : setd
sel := 3
PRI sett | h, m
{{shows the set time menu}}
text.out($00) 'clear display
showtime(3, 3) 'show current time at X, Y
h := gethour 'get hour and minute
m := getminute
text.colour(2) 'change text colour to yellow
repeat until code == enter 'repeat until enter is pressed
text.xy(3, 3)
text.dec(h>>4 & $03) 'show hour (BCD)
text.dec(h & $0F)
repeat until rc.getcommand 'wait until a button is pressed
code := rc.getcommand
rc.flush
if code == down 'increment hour
++h
if (h & $0F) => 10
h &= $30
h += 16
if (h & $3F) => $24 'loop hour
h := 0
if code == up 'decrement hour
if (h & $0F) > 1
--h
elseif (h & $30) > 0
h -= 16
h |= $09
else 'loop hour
h := $23
text.xy(3, 3) 'show set hour in white
text.colour(0)
text.dec(h>>4 & $03)
text.dec(h & $0F)
text.str(string(":"))
code := 0
text.colour(2)
repeat until code == enter 'repeat until enter is pressed
text.xy(6, 3)
text.dec(m>>4 & $07) 'show minutes in yellow text (BCD)
text.dec(m & $0F)
repeat until rc.getcommand 'wait until enter is pressed
code := rc.getcommand










