Datasheet
Jon Waddington
97
text.xy(3, 3) 'move text cursor to X, Y
text.colour(0) 'set text colour to white
case day 'show set day in white
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"))
code := 0 'empty code (RC5)
text.colour(2) 'set yellow text colour
repeat until code == enter 'repeat unitl enter is pressed
text.xy(7, 3) 'move text cursor to X, Y
text.dec(date>>4 & $03) 'show date (BCD)
text.dec(date & $0F)
repeat until rc.getcommand 'wait until button is pressed
code := rc.getcommand 'code = RC5 code
rc.flush 'flush RC5
if code == down 'if down is pressed
++date 'increment date
if (date & $0F) => 10 'if lower 4 bits => 10
date &= $30 'clear lower bits
date += 16 'add 1 to upper 3 bits
if (date & $3F) => $32 'loop date if it reaches 32
date := 1
if code == up 'if up is pressed
if (date & $0F) > 1 'if lower 4 bits > 1
--date 'decrement date
elseif (date & $30) > 0 'if lower 4 bits = 0 and upper 3 > 0
date -= 16 '- 1 from upper 3 bits
date |= $09 'make lower 4 bits = 9
else 'if date = 0
date := $31 'loop
text.xy(7, 3) 'move text cursor to X, Y
text.colour(0) 'set text colour to white
text.dec(date>>4 & $03) 'display the set date
text.dec(date & $0F)
code := 0 'empty code (RC5)
text.colour(2) 'set text colour to yellow
repeat until code == enter 'repeat until enter is pressed
text.xy(10, 3) 'move text cursor to X, Y
case m 'display month
1 : text.str(string("Jan"))
2 : text.str(string("Feb"))
3 : text.str(string("Mar"))
4 : text.str(string("Apr"))
5 : text.str(string("May"))
6 : text.str(string("Jun"))
7 : text.str(string("Jul"))










