Datasheet

Jon Waddington
99
y := $99
text.xy(16, 3) 'show set year in white
text.colour(0)
text.dec(y>>4 & $0F)
text.dec(y & $0F)
setdatebcd(date, day, m, y) 'save changes of date
PRI wait : c | m, i
{{waits for key press while updating time}}
rc.flush 'flush RC5
m := getminute 'get minute value
repeat until rc.getcommand 'repeat until button is pressed
repeat i from 0 to 19 'repeat 20 times
waitcnt(cnt + 4_000_000) 'wait 50ms
if rc.getcommand 'if button is pressed
i := 20 'exit repeat
if m <> getminute 'if minute value has changed
showtime(35, 0) 'show time
showdate(0, 0) 'show date
m := getminute 'update minute
c := rc.getcommand 'return RC5 code
rc.flush 'flush RC5 code
PRI showtime(x, y) | m, h
{Object shows the time at X, Y position on the screen}
m := getminute 'get the minute value
h := gethour 'get the hour value
text.xy(x, y) 'move text cursor to X, Y
text.dec(h>>4 & $03) 'display the 10s h
text.dec(h & $0F) 'display the units of h
text.str(string(":"))
text.dec(m>>4 & $07) 'display the 10s of m
text.dec(m & $0F) 'display the units of m
PRI showdate(x, y) | date, day, m, yr
{Object shows the date and X, Y position on the screen}
date := getdate 'get the date value
day := getday 'get the day value
m := getmonth 'get the month value
yr := getyear 'get the year value
text.xy(x, y) 'move text cursor to X, Y
case day 'Display the day
0 : text.str(string("Sun"))
1 : text.str(string("Mon"))
2 : text.str(string("Tue"))
3 : text.str(string("Wed"))
4 : text.str(string("Thu"))
5 : text.str(string("Fri"))
6 : text.str(string("Sat"))