' ************************************ ' * PICO: SingleDigit-DEMO * ' * with RTC, BUZZER, * ' * Photodiode and ENCODER * ' * LED-Basic >= 15.2.7 required * ' * modyfied by Vanessa Ver. 1.15 * ' ************************************ ' Operations manual: ' ' On startup, the display shows the software version for approx. 3 seconds. ' To reset to factory defaults: as soon as the software version number displays, ' press and hold the Encoder button until unit beeps. ' ' Usage: ' ' Turn the knob to adjust the display colour.(0-9 solid colour, 10 white, ' 11 incandecent, 12-14 multi colour). ' Fading is temporary disabled during colour set. ' Short press knob to switch between Clock and Date display, ' Changing display also ensures colour setting is saved when restarting. ' Date display automatically returns to clock display after approx. 3 seconds. ' ' Long press spinner button to enter settings menu (white). ' Turn knob to choose an option, short press to select, long press to exit. ' (with saving changes) ' After 4 seconds inactivity, the unit returns to display mode ' (without saving changes). ' ' Settings menu (white): ' Setting 0: adjust brightness (default 8) ' 0 = variable brightness(Photodiode), 1..9 = brightness level. ' Setting 1: Auto date display on / off (default 0) ' 0 = off ' 1 = on ' Setting 2: Set the time (yellow) ' Short press changes between hours, minutes, seconds ' long press saves the time ' Setting 3: Seconds mode on / off (default 0) ' 0 = off ' 1 = on ' Setting 4: Set the date (yellow) ' Short press changes between days, months, years ' long press saves the date ' Setting 5: Alarm on / off (default 0) ' 0 = off ' 1 = on ' Setting 6: Set alarm time (default 12:00) (red) ' Short press changes between hours and minutes ' Long press saves the alarm time ' Setting 7: Digit fade mode (default 3) ' 0..5 = digit fade duration ' ' All settings remain in case of power failure (EEPROM). ' Softwareversion check on startup. ' ' Seconds Mode: all ten seconds, Seconds are displayed for 10 seconds. ' When alarm is On, alarm time displays twice every ten minutes (minutes 02, 06, ' 12, 16, 22...) in red. Alarm can be interrupted by keystroke. ' Fade mode: Digits are fading depending on value. ' ' '================================================ ' PICO: SingleDigit-DEMO: WS2812 + RTC-MODUL + BUZZER + ENCODER + PHOTODIODE '================================================ ' 5V -> 5V (WS2812) ' DI -> DO | OUT (WS2812) ' GND -> GND (WS2812) ' SDA -> SDA (RTC) ' SCL -> SCL (RTC) ' ENA -> ENA (ENCODER) ' ENB -> ENB (ENCODER) ' KEY -> Pico Key (ENCODER) ' PHOTO -> A0 (PHOTODIODE) ' BEEP -> BEEP (BUZZER) ' 3V3 -> 3V3 ' GND -> GND '================================================ ### L10 CGRB M90 P1 F40 IO.sys(500, 0x01) ' set A0 to analog(Photodiode) ' Set initial EEPROM state (for testing, uncomment to set on run) ' IO.eewrite(0, 115) ' Software Version ' IO.eewrite(1, 11) ' 1 = Time Colour (11) ' IO.eewrite(2, 4) ' 2 = Date Colour (4) ' IO.eewrite(4, 8) ' 4 = Brightness (8) ' IO.eewrite(5, 0) ' 5 = Alarm (0) ' IO.eewrite(6, 12) ' 6 = Alarm Hour (12) ' IO.eewrite(7, 0) ' 7 = Alarm Minute (0) ' IO.eewrite(8, 0) ' 8 = Auto Date Display (0) ' IO.eewrite(13, 0) ' 13 = Seconds Mode (0) ' IO.eewrite(17, 3) ' 17 = Digits fade (3) ' ' Nixie Digit Index 10: data 5, 0, 6, 1, 7, 2, 8, 3, 9, 4 ' Colour Index (0..14) 20: data 5, 20, 50, 90, 120, 160, 200, 240, 300, 340, 1000, 1001, 1002, 1003, 1004 ' Brightness Table 30: data 0, 15, 30, 50, 70, 100, 140, 180, 220, 255 ' LED-INDEX SET led.ihsv(0, 0, 0, 0) 'off led.ihsv(2, 0, 0, 128) 'white (settings) led.ihsv(3, 2, 255, 128) 'red (set alarm) led.ihsv(5, 37, 254, 96) 'yellow (set date / time) ' Version LED.iled(2, read 10, 1) LED.show() delay 1500 LED.blackout() LED.iled(2, read 10, 1) LED.show() delay 1500 LED.blackout() LED.iled(2, read 10, 5) LED.show() delay 1500 ' EEPROM INIT if (IO.eeread(0)) <> 115 or (IO.getkey()) = 16 then gosub 8000 'Softwareversion check or reset print "PICO: SingleDigit-DEMO" print " by Vanessa" '================================================ ' GLOBAL VARS ' c = colour, m = mode, t,y,w = temp, i = loop, j = counter, ' x = alarm silenced, z = counter, h = hue, v = brightness, b = brightness subtraction ' l = transition brightness, u = last second shown for fade '==== STARTUP =================================== 99: y = 0 ' colour set time u = 11 ' Last second shown m = 0 ' Initially in time display x = 0 ' Alarm not silenced goto 190 '==== MAIN LOOP ================================= 100: t = IO.getenc() ' Read Encoder if y < 0 then y = y + 1 if t = c then goto 105 y = -300 ' colour set time c = t ' color set (knob turned) z = 0 ' counter reset 105: r = IO.getrtc(0) ' seconds a = IO.getrtc(2) ' hours s = IO.getrtc(1) ' minutes if r = 0 then x = 0 ' reset alarm silencer b = 0 ' brightness subtraction if (IO.eeread(5)) = 1 and x = 0 and (IO.eeread(6)) = a and (IO.eeread(7)) = s then gosub 9100 ' alarm so ringing if m = 0 and r = 48 and (IO.eeread(8)) = 1 goto 180 ' date auto display if s % 10 = 2 or s % 10 = 6 and (IO.eeread(5)) = 1 and r = 1 gosub 700 ' show alarm time 108: gosub 9000 ' Get key. if k = 1 then goto 110 ' short press: change display mode if k = 2 then goto 10000 ' settings menu goto 200 110: '==== SHORT PRESS: MODE SWITCH ==== gosub 9100 ' BEEP if m = 0 then goto 180 ' change time to date display if m = 1 then goto 185 ' change date to time display 180: ' change from time to date display if (IO.eeread(m + 1)) <> c then IO.eewrite(m + 1, c)' saves current time colour to EEPROM m = 1 ' change to date mode if k = 1 then x = 1 ' silence alarm when spinner pressed goto 190 ' done 185: ' change from date to time display if (IO.eeread(m + 1)) <> c then IO.eewrite(m + 1, c)' saves current date display to EEPROM m = 0 ' mode change to time 190: 'NB: also entry point from start c = IO.eeread(m + 1) ' sets colour from eeprom IO.setenc(c, 14, 0) ' set spinner to 13 colour options + wraparound z = 0 ' reset counter 200: if z & 15 <> 0 then goto 210 ' only check brightness once per 15 cycles if (read 30, IO.eeread(4)) = 0 then v = (IO.getadc(0)) * 4 else v = read 30, IO.eeread(4)' Set brightness from EEPROM if v < 20 then v = 20 ' minimum at Photodiode If v > 254 then v = 254 ' maximum at Photodiode 210: LED.iall(0) ' Clear display if m <> 0 then goto 220 ' If date mode, skip time display gosub 500 ' Show time - set LEDs LED.show() ' Show time - show LEDs goto 100 ' Back to beginning of loop 220: if m <> 1 then goto 100 ' If not date mode, re-enter loop gosub 600 ' SHOW DATE - set LEDs LED.show() ' Show date - show LEDs if z > 240 then goto 185 ' Return to TIME display after ca. 8sec goto 100 ' Back to beginning of loop '================================================ ' handle flip fade animation 400: if n = i then goto 410 b = v - l ' set the subtraction value to our transition brightness gosub 1000 b = l n = i 410: gosub 1000 b = 0 return '================================================ ' SHOW TIME routine ' VAR: n, p, j 500: p = 0 if (IO.eeread(13)) = 0 or r % 20 > 9 goto 510 ' time n = r % 10 ' seconds gosub 580 ' calculate the flip brightness if r % 10 = 0 then i = 0 else i = n - 1 if i < 0 then i = 9 gosub 400 ' display seconds 1s if z < 32751 then z = z + 1 else z = 0 return 510: if r % 10 = 0 and y >= 0 goto 560 ' do nothing if r % 10 > 2 goto 520 n = a / 10 ' Hours 10 gosub 570 ' calculate the brightness gosub 1000 goto 560 520: if r % 10 > 4 goto 530 ' Hours 1 n = a % 10 ' Hours 1 gosub 570 ' calculate the brightness gosub 1000 goto 560 530: if r % 10 > 6 goto 540 ' Hours 10 n = s / 10 ' Minutes 10 gosub 570 ' calculate the brightness gosub 1000 goto 560 540: if r % 10 = 9 and y >= 0 goto 560 ' do nothing n = s % 10 ' minutes gosub 570 ' calculate the brightness gosub 1000 560: if z < 32751 then z = z + 1 else z = 0 return 570: ' calculate the brightness if r % 2 = 1 and j = 1 then l = 0 if r % 2 = 1 then j = 0 if r % 2 = 0 and j = 0 then l = 0 if r % 2 = 0 then j = 1 i = 6 - IO.eeread(17) ' fade value l = l + 1 + i * (v / 50) ' increase the level of transition brightness if l > v then l = v ' don't increase the level beyond the set brightness ' finished calculating brightness if y < 0 return ' color set time if r % 2 = 1 then b = v - l else b = v - (v - l) ' set the subtraction value to our transition brightness return 580: ' calculate the flip brightness if u <> n then l = 0 if u <> n then u = n i = 6 - IO.eeread(17) ' fade value l = l + 1 + i * (v / 40) ' increase the level of transition brightness if l > v then l = v ' don't increase the level beyond the set brightness ' finished calculating the flip brightness return '================================================ ' SHOW DATE ' VAR: n, p 600: p = 0 ' singledigit if z > 60 goto 610 n = (IO.getrtc(3)) / 10 'day gosub 1000 ' Day 10s goto 690 610: if z > 120 goto 620 n = (IO.getrtc(3)) % 10 gosub 1000 ' Day units goto 690 620: if z > 180 goto 630 n = (IO.getrtc(4)) / 10 ' month gosub 1000 ' Month 10s goto 690 630: n = (IO.getrtc(4)) % 10 gosub 1000 ' Month units 690: if z % 60 = 0 then LED.blackout() z = z + 1 return '================================================ ' SHOW Alarm 700: if (IO.eeread(5)) = 1 and (IO.eeread(6)) = a and (IO.eeread(7)) = s then return ' alarm ringing so don't display alarm time LED.blackout() i = IO.eeread(6) for j = 1 to 10 LED.iled(3, read 10, i / 10) LED.show() delay 200 LED.blackout() next j for j = 1 to 10 LED.iled(3, read 10, i % 10) LED.show() delay 200 LED.blackout() next j i = IO.eeread(7) ' alarm minutes for j = 1 to 10 LED.iled(3, read 10, i / 10) LED.show() delay 200 LED.blackout() next j for j = 1 to 10 LED.iled(3, read 10, i % 10) LED.show() delay 200 LED.blackout() next j return '================================================ ' Character display routine for date / time (using set colour mode) 1000: t = read 20, c ' read colour value from index if t > 360 then goto 1010 LED.ihsv(1, t, 255, v - b) ' set "standard 1 colour" at brightness V goto 1090 1010: if t <> 1000 then goto 1015 ' position 10 = white LED.ihsv(1, 0, 0, v - b) goto 1090 1015: if t <> 1001 then goto 1020 ' position 11 = incandecent LED.ihsv(1, 25, 205, v - b) goto 1090 1020: if t <> 1002 then goto 1030 ' position 12 = multi-colour LED.ihsv(1, h, 255, v - b) h = (p * 6 + z) % 360 ' set "standard 1" as 6* position + counter mod 360 goto 1090 1030: if t <> 1003 then goto 1040 ' position 13 = gently cycling LED.ihsv(1, h, 255, v - b) ' set "standard 1" as counter/4 mod 360 h = (z / 4) % 360 goto 1090 1040: 'we assume t = 1004 = position 14 = gently cycling 2 led.ihsv(1, h, 255, v - b) h = ((2 * z) + (2 * (50 - p))) % 360 1090: LED.iled(1, p + read 10, n) ' show character return '================================================ ' EEPROM INIT 8000: IO.eewrite(0, 115) ' Software Version IO.eewrite(1, 11) ' 1 = Time Colour (11) IO.eewrite(2, 4) ' 2 = Date Colour (4) IO.eewrite(4, 8) ' 4 = Brightness (8) IO.eewrite(5, 0) ' 5 = Alarm (0) IO.eewrite(6, 12) ' 6 = Alarm Hour (12) IO.eewrite(7, 0) ' 7 = Alarm Minute (0) IO.eewrite(8, 0) ' 8 = Auto Display Date (0) IO.eewrite(13, 0) ' 13 = Seconds Mode (0) IO.eewrite(17, 3) ' 17 = Digits fade (3) IO.beep(35) delay 800 IO.beep(0) return '================================================ ' GETKEY ' VAR: k, i, RET: k ' k: 0 = No Key, 1 = Short, 2 = LONG press 9000: k = IO.getkey() if k = 0 or k > 16 goto 9020 'only Pico Key i = 0 9010: k = IO.keystate() if k = 1 or k = 193 goto 9015 'only Pico Key delay 10 i = i + 1 if i < 50 then goto 9010 k = 2 ' LONG PRESS return 9015: k = 1 ' SHORT PRESS return 9020: k = 0 return '================================================ ' BEEP 9100: IO.beep(35) delay 25 IO.beep(0) return '================================================ ' Settings menu ' VAR p: position, t: temp, y: value 10000: gosub 9100 ' BEEP p = 0 10005: z = 0 IO.setenc(p, 7, 0) ' Set Encoder (Spinner) to give 0-6 positions 10010: t = IO.getenc() ' Read Encoder if t = p then goto 10020 p = t z = 0 ' counter reset 10020: gosub 9000 ' GETKEY if k = 0 then goto 10050 if k = 1 then goto 10060 gosub 9100 ' BEEP. K = 2 so long press so exit goto 99 ' long press so exit 10050: LED.iall(0) ' blank if z & 15 < 11 then LED.iled(2, read 10, p) ' White first pixel number flashes. LED.show() z = z + 1 if z > 300 then goto 99 ' Time-out, back to time display goto 10010 10060: if p = 0 then goto 11000 ' F0: Brightness if p = 1 then goto 17000 ' F1: Auto date display on / off if p = 2 then goto 13000 ' F2: Time set if p = 3 then goto 12200 ' F3: Seconds Mode on/off if p = 4 then goto 14000 ' F4: Date set if p = 5 then goto 15000 ' F5: Alarm on / off if p = 6 then goto 16000 ' F6: Alarm time set if p = 7 then goto 15100 ' F7: Digit fade goto 10010 '================================================ ' F0: BRIGHTNESS SELECTION ' VAR: y,t,z,k 11000: gosub 9100 ' BEEP y = IO.eeread(4) ' Read Brightness Value from EEPROM 11005: z = 0 ' counter IO.setenc(y, 9, 0) ' 15 brightness values 11010: t = IO.getenc() if t = y then goto 11020 y = t z = 0 ' movement so reset counter 11020: gosub 9000 ' GETKEY if k = 0 then goto 11050 gosub 9100 ' BEEP goto 11070 ' short press 11050: LED.iall(0) ' blank LED.iled(3, read 10, 0) ' show in Settings 0 brightness if z & 15 > 10 then goto 11060 ' (flashing) LED.iled(2, read 10, y) ' brightness units 11060: LED.show() z = z + 1 if z <= 300 then goto 11010 ' timeout goto 10005 ' return to Settings menu without save 11070: if y <> (IO.eeread(4)) then IO.eewrite(4, y) ' Write Brightness Value goto 10005 ' return to Settings menu '================================================ ' F3: Seconds Mode on / off ' VAR: y,t,z,k 12200: gosub 9100 ' BEEP y = IO.eeread(13) ' Read Seconds Mode Value 12205: z = 0 IO.setenc(y, 1, 0) 'options on, off 12210: t = IO.getenc() if t = y then goto 12220 y = t z = 0 12220: gosub 9000 ' GETKEY if k = 0 then goto 12250 gosub 9100 ' BEEP key pressed goto 12270 12250: LED.iall(0) ' blank LED.iled(3, read 10, 3) ' Settings menu option 3 if z & 15 > 10 then goto 12260 ' light LEDs 10 in 15 cycles LED.iled(2, read 10, y) 12260: LED.show() z = z + 1 if z <= 300 then goto 12210 ' timeout goto 10005 ' return to system menu without save 12270: if y <> (IO.eeread(13)) then IO.eewrite(13, y) ' Write Seconds Mode value goto 10005 '================================================ ' F2: TIME SET ' VAR: w,x,y,t,z,k 13000: y = IO.getrtc(2) ' Read Hour x = IO.getrtc(1) ' Read Minute w = 0 ' Second = 0 13005: ' hours gosub 9100 ' BEEP z = 0 IO.setenc(y, 23, 0) ' 0-23 wraparound 13010: t = IO.getenc() if t = y then goto 13020 y = t z = 0 ' reset counter 13020: gosub 9000 ' GETKEY if k = 1 then goto 13100 ' short press > minutes if k = 2 then goto 13300 ' long press > save, exit 13050: ' no key pressed LED.iall(0) ' blank if z & 15 > 10 then goto 13060 ' only light 1st 2 pixels 10 / 15 cycles LED.iled(2, read 10, y / 10) ' hours 10s, white 13060: LED.iled(5, read 10, y % 10) ' hours units, white LED.show() z = z + 1 if z <= 500 then goto 13010 ' time out goto 13320 '................................................ 13100: ' minutes gosub 9100 ' BEEP z = 0 IO.setenc(x, 59, 0) ' 0 - 59 wraparound 13110: t = IO.getenc() if t = x then goto 13120 x = t z = 0 ' reset counter 13120: gosub 9000 ' GETKEY if k = 1 then goto 13200 ' short press > seconds if k = 2 then goto 13300 ' long press > save, exit 13150: LED.iall(0) ' blank if z & 15 > 10 then goto 13160 ' only show minutes 10 / 15 cycles LED.iled(2, read 10, x / 10) ' minutes, 10s, white 13160: LED.iled(5, read 10, x % 10) ' minutes, units, white LED.show() z = z + 1 if z <= 500 then goto 13110 ' timeout goto 13320 '................................................ 13200: ' seconds gosub 9100 ' BEEP z = 0 IO.setenc(w, 11, 0) ' 0 - 55 in 5 second increments, wraparound 13210: t = IO.getenc() if t = w then goto 13220 w = t z = 0 13220: gosub 9000 ' GETKEY if k = 1 then goto 13005 ' short click > hours if k = 2 then goto 13300 ' long click > save, exit 13250: LED.iall(0) ' blank if z & 15 > 10 then goto 13260 ' only light seconds 10 / 15 cycles LED.iled(2, read 10, (w * 5) / 10) ' seconds 10s white 13260: LED.iled(5, read 10, (w * 5) % 10) ' seconds units white LED.show() z = z + 1 if z <= 500 then goto 13210 ' time out goto 13320 '................................................ 13300: ' save, exit gosub 9100 ' BEEP 13310: IO.setrtc(0, w * 5) ' Write Seconds IO.setrtc(1, x) ' Write Minutes IO.setrtc(2, y) ' Write Hours 13320: goto 10005 ' return to settings menu '================================================ ' F4: DATE SETUP ' VAR: w,x,y,t,z,k 14000: y = (IO.getrtc(3)) - 1 ' Read Day x = (IO.getrtc(4)) - 1 ' Read Month w = (IO.getrtc(5)) % 100 ' Read Year 14005: ' days gosub 9100 ' BEEP z = 0 IO.setenc(y, 30, 0) ' day 1-31 14010: t = IO.getenc() if t = y then goto 14020 y = t z = 0 ' counter reset 14020: gosub 9000 ' GETKEY if k = 1 then goto 14100 ' short push, go to month if k = 2 then goto 14300 ' long push, save and exit 14050: ' flashing LEDs LED.iall(0) ' blank if z & 15 > 10 then goto 14060 ' show LEDs in 10 out of every 15 cycles (flash) LED.iled(2, read 10, (y + 1) / 10) ' days 10s 14060: ' static LEDs LED.iled(5, read 10, (y + 1) % 10) ' days units LED.show() z = z + 1 if z <= 500 then goto 14010 ' time out goto 14320 ' exit '................................................ 14100: ' months gosub 9100 ' BEEP z = 0 IO.setenc(x, 11, 0) ' 12 months 14110: t = IO.getenc() if t = x then goto 14120 x = t z = 0 ' reset timeout timer 14120: gosub 9000 ' GETKEY if k = 1 then goto 14200 ' short press > years if k = 2 then goto 14300 14150: LED.iall(0) ' blank if z & 15 > 10 then goto 14160 LED.iled(2, read 10, (x + 1) / 10) ' months 10s depending on date format 14160: LED.iled(5, read 10, (x + 1) % 10) ' months units depending on date format LED.show() z = z + 1 if z <= 500 then goto 14110 ' time out check goto 14320 ' exit '................................................ 14200: ' years gosub 9100 ' BEEP z = 0 IO.setenc(w, 99, 0) ' 2000 - 2099 14210: t = IO.getenc() if t = w then goto 14220 w = t z = 0 ' reset timeout counter 14220: gosub 9000 ' GETKEY if k = 1 then goto 14005 ' short press = back to days if k = 2 then goto 14300 ' long press = save and exit 14250: LED.iall(0) ' blank if z & 15 > 10 then goto 14260 ' display 10 cycles out of 15 (flash) LED.iled(2, read 10, w / 10) 14260: ' display solid LED.iled(5, read 10, w % 10) LED.show() z = z + 1 if z <= 500 then goto 14210 ' time out check goto 14320 ' exit '................................................ 14300: gosub 9100 ' BEEP r = w + 2000 ' year in 4 digits if x = 1 and r % 4 = 0 and y > 28 then goto 14330 ' 30/31 days in Feb in leap year. forget year 2000! if x = 1 and r % 4 <> 0 and y > 27 then goto 14330 ' 29 / 30 / 31 days Feb non-leap year 14305: ' months with 30 days if x = 3 or x = 5 or x = 8 or x = 10 and y > 29 then goto 14330 ' 31 days in months with 30 days 14310: ' set date IO.setrtc(5, w + 2000) ' Write Year IO.setrtc(4, x + 1) ' Write Month IO.setrtc(3, y + 1) ' Write Day 14320: ' exit goto 10005 14330: ' non-sane date for r = 1 to 15 ' non-sane days in month gosub 9100 ' beep 100 times next r goto 14005 ' return to day setting '================================================ ' F5: ALARM on / off ' VAR: y,t,z,k 15000: gosub 9100 ' BEEP y = IO.eeread(5) ' Read alarm Value 15005: z = 0 IO.setenc(y, 1, 0) 15010: t = IO.getenc() if t = y then goto 15020 y = t z = 0 15020: gosub 9000 ' GETKEY if k = 0 then goto 15050 gosub 9100 ' BEEP goto 15070 15050: LED.iall(0) ' blank LED.iled(3, read 10, 5) if z & 15 > 10 then goto 15060 LED.iled(2, read 10, y) 15060: LED.show() z = z + 1 if z <= 300 then goto 15010 goto 10005 ' return to system menu without save 15070: if y <> (IO.eeread(5)) then IO.eewrite(5, y) ' Read alarm Value goto 10005 '================================================ ' F7: DIGIT FADE ' VAR: y,t,z,k 15100: gosub 9100 ' BEEP y = IO.eeread(17) ' Read Digit fade Value from EEPROM 15105: z = 0 ' counter IO.setenc(y, 5, 0) ' 5 fade values 15110: t = IO.getenc() if t = y then goto 15120 y = t z = 0 ' movement so reset counter 15120: gosub 9000 ' GETKEY if k = 0 then goto 15150 gosub 9100 ' BEEP goto 15170 ' short press 15150: LED.iall(0) ' blank LED.iled(3, read 10, 7) ' show in System 7 i.e. fade if z & 15 > 10 then goto 15160 ' (flashing) LED.iled(2, read 10, y) ' fade units 15160: LED.show() z = z + 1 if z <= 300 then goto 15110 ' timeout goto 10005 ' return to settings menu without save 15170: if y <> (IO.eeread(17)) then IO.eewrite(17, y) ' Write fade Value goto 10005 ' return to settings menu '================================================ ' F6: ALARM Time set ' VAR: w,x,y,t,z,k 16000: y = IO.eeread(6) ' Read alarm Hour x = IO.eeread(7) ' Read alarm Minute w = 0 ' Second = 0 16005: gosub 9100 ' BEEP z = 0 IO.setenc(y, 23, 0) 16010: t = IO.getenc() if t = y then goto 16020 y = t z = 0 16020: gosub 9000 ' GETKEY if k = 1 then goto 16100 if k = 2 then goto 16300 16050: LED.iall(0) ' blank if z & 15 > 10 then goto 16060 LED.iled(2, read 10, y / 10) 16060: LED.iled(3, read 10, y % 10) LED.show() z = z + 1 if z <= 500 then goto 16010 ' 20 Sek. goto 16320 '................................................ 16100: gosub 9100 ' BEEP z = 0 IO.setenc(x, 59, 0) 16110: t = IO.getenc() if t = x then goto 16120 x = t z = 0 16120: gosub 9000 ' GETKEY if k = 1 then goto 16005 if k = 2 then goto 16300 16150: LED.iall(0) ' blank if z & 15 > 10 then goto 16160 LED.iled(2, read 10, x / 10) 16160: LED.iled(3, read 10, x % 10) LED.show() z = z + 1 if z <= 500 then goto 16110 ' 20 Sek. goto 16320 '................................................ 16300: gosub 9100 ' BEEP 16310: if x <> (IO.eeread(7)) then IO.eewrite(7, x) ' Write alarm Minutes if y <> (IO.eeread(6)) then IO.eewrite(6, y) ' Write alarm Hours 16320: goto 10005 '================================================ ' F7: Date AutoDisplay on / off ' VAR: y,t,z,k 17000: gosub 9100 ' BEEP y = IO.eeread(8) ' Read auto Datum Value 17005: z = 0 IO.setenc(y, 1, 0) 17010: t = IO.getenc() if t = y then goto 17020 y = t z = 0 17020: gosub 9000 ' GETKEY if k = 0 then goto 17050 gosub 9100 ' BEEP goto 17070 17050: LED.iall(0) ' blank LED.iled(3, read 10, 1) if z & 15 > 10 then goto 17060 LED.iled(2, read 10, y) 17060: LED.show() z = z + 1 if z <= 300 then goto 17010 goto 10005 ' return to system menu without save 17070: if y <> (IO.eeread(8)) then IO.eewrite(8, y) ' Read auto Datum Value goto 10005 '================================================ end