--- title: "Digital Wristwatch" id: 72420 type: "computer_media" slug: "digital-wristwatch" url: "http://localhost/computer_media/digital-wristwatch/" markdown_url: "http://localhost/computer_media/digital-wristwatch.md" published_at: "2026-10-23T07:47:08+00:00" modified_at: "2026-10-23T07:47:08+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/10/watch-1.png" excerpt: "Draws a quartz wristwatch on screen and runs it as a twelve-hour clock with AM and PM, set with single keys, or as a stopwatch." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "D. Richardson" slug: "d-richardson" taxonomy: "indiv" url: "http://localhost/indiv/d-richardson/" genre: - name: "Clock" slug: "clock" taxonomy: "genre" url: "http://localhost/type/clock/" media_type: "Program" programmers: - name: "D. Richardson" slug: "d-richardson" taxonomy: "indiv" url: "http://localhost/indiv/d-richardson/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Digital%20Wristwatch%20%281984%29%28Richardson%2C%20D.%29%28TS2068%29%28US%29%28Program%29.zip" tsrun_member: "Digital Wristwatch (1984)(Richardson, D.)(TS2068)(US)(Program)/Digital Wristwatch (1984)(Richardson, D.)(TS2068)(US)(Program).tap" mediadate: "1984" images: - url: "http://localhost/wp-content/uploads/2026/10/watch-1.png" - url: "http://localhost/wp-content/uploads/2026/10/watch-2.png" related_content: - id: 10285 title: "ZX Computing" type: "periodical" url: "http://localhost/periodical/zx-computing/" - id: 72713 title: "SNUG-ISTUG Public Domain Library" type: "computer_media" url: "http://localhost/computer_media/snug-istug-public-domain-library/" media_type_tags: "Clock" license: false --- # Digital Wristwatch Draws a digital wristwatch, with strap, curved case and “ASEIKO Quartz” face, and runs it as a clock. Before starting you set the hours with `H`, the minutes with `M` and the seconds with `S` (in steps of five), and choose AM or PM with `A` or `P`. `G` starts it; started from zero it works as a stopwatch. Hours run from 1 to 12 and AM and PM change over at twelve o’clock. REMs credit D. Richardson and *ZX Computing*, February/March 1984, and note that more accurate time can be kept by changing the `PAUSE` in line 110. ## Program Analysis ### Structure - Lines 30–80: draw the watch (subroutine 250) and take the setting keys. - Lines 85–200: the running clock. `PAUSE 59` makes each second, then seconds, minutes and hours carry over. - Lines 250–750: the drawing. The case sides are `DRAW` commands with an angle argument, which draws arcs; UDG l is a small bracket printed beside the labels. ## Notable Techniques - The positions of the hour, minute, second and AM/PM fields are kept as embedded `AT` strings (`CHR$ 22+CHR$ row+CHR$ column`) in `h$`, `m$`, `s$` and `a$`, so each update is a short `PRINT`. ## Potential Issues - The clock counts `PAUSE 59` plus the time BASIC takes to run each loop, so it drifts. - After 12, line 170 sets the hour to 0 but prints 1. The next hour then shows 1 again, so one o’clock lasts two hours. This program came from an Oliger (JLO SAFE) disk, a copy of the SNUG library disk 17/18, and was converted to load from tape. No changes were needed. It was tested in ZEsarUX, setting a time and starting the clock. ## Source Code ``` 5 REM > DIGITAL WRISTWATCH < 10 REM 15 REM RESET ZX COMPUTING, Feb/Mar 1984 20 REM by D. Richardson 25 REM More accurate time can be kept by changing the pause in line 110 30 CLS : GO SUB 250 45 IF INKEY$<>"" THEN GO TO 45 50 IF INKEY$="" THEN GO TO 50 55 IF INKEY$="h" THEN PRINT AT 10,17;h+1: LET h=h+1: IF h>12 THEN LET h=1: PRINT h$;"1 ": GO TO 45 60 IF INKEY$="m" THEN PRINT m$;m+1: LET m=m+1: IF m>59 THEN LET m=0: PRINT m$;"0 ": GO TO 45 65 IF INKEY$="s" THEN PRINT s$;s+5: LET s=s+5: IF s>59 THEN LET s=0: PRINT s$;"0 ": GO TO 45 70 IF INKEY$="p" THEN LET r$="PM": PRINT a$;r$: GO TO 45 75 IF INKEY$="a" THEN LET r$="AM": PRINT a$;r$: GO TO 45 80 IF INKEY$<>"g" THEN GO TO 45 85 FOR n=0 TO 11: PRINT AT n,0;" ": NEXT n 90 PRINT AT 15,2;"As ""TIME""": PRINT AT 16,5;"goes by" 110 PAUSE 59 120 LET s=s+1 130 IF s<60 THEN PRINT s$;s: GO TO 110 140 LET s=0: PRINT s$;"0 " 145 LET m=m+1: IF m<60 THEN PRINT m$;m: GO TO 110 155 LET m=0: PRINT m$;"0 " 160 LET h=h+1: IF h<12 THEN PRINT h$;h: GO TO 110 165 IF h=12 THEN PRINT h$;h: GO TO 195 170 IF h=13 THEN LET h=0: PRINT h$;" 1": GO TO 110 195 IF r$="AM" THEN LET r$="PM": PRINT a$;r$: GO TO 110 200 IF r$="PM" THEN LET r$="AM": PRINT a$;r$: GO TO 110 250 LET h=0: LET m=0: LET s=0 255 BORDER 0 260 LET h$=CHR$ 22+CHR$ 10+CHR$ 17 270 LET m$=CHR$ 22+CHR$ 10+CHR$ 20 280 LET s$=CHR$ 22+CHR$ 10+CHR$ 23 285 PRINT h$;h,m$;m,s$;s 290 LET r$="AM" 295 LET a$=CHR$ 22+CHR$ 14+CHR$ 17: PRINT a$;r$ 300 PRINT AT 0,0;"To set PRESS": PRINT " H for hours": PRINT " M - mins": PRINT " S - secs": PRINT " AorP-AM/PM": PRINT '" To START": PRINT " PRESS 'G'": PRINT ''" (Stopwatch": PRINT " only""G"")" 350 PRINT AT 12,17;"Hr";AT 12,20;"Mn";AT 12,23;"Sc" 400 PRINT AT 14,21;"SA19" 500 PRINT AT 7,18;"ASEIKO" 510 PRINT AT 16,18;"Quartz" 520 PLOT 143,128: DRAW 0,-97,.72*PI 530 PLOT 192,31: DRAW 0,97,.72*PI 540 PLOT 143,175: DRAW 0,-51: DRAW 0,-89,.67*PI: DRAW 0,-35 550 PLOT 192,0: DRAW 0,35: DRAW 0,89,.67*PI: DRAW 0,51 560 FOR y=0 TO 35 STEP 5: PLOT 143,y: DRAW 49,0: NEXT y 570 FOR y=124 TO 175 STEP 5: PLOT 143,y: DRAW 49,0: NEXT y 580 PLOT 203,99: DRAW 0,-15: DRAW -71,0: DRAW 0,15: DRAW 71,0 590 PLOT 128,105: DRAW 79,0: DRAW 0,-51: DRAW -79,0: DRAW 0,51 700 FOR n=0 TO 7 710 READ a 720 POKE USR "l"+n,a: NEXT n 730 PRINT AT 12,28;"l" 740 RETURN 750 DATA 248,8,8,248,0,0,0,0 ```