How to build a clock on the C64

Channel:
Subscribers:
29,700
Published on ● Video Link: https://www.youtube.com/watch?v=J2rUiV-hDmw



Category:
Guide
Duration: 30:29
874 views
36


In this video I'll demonstrate how to build a simple clock on the C64. We'll go through this process step by step, including the built-in TI and TI$ variables, string formatting with LEFT$, RIGHT$ and MID$, as well as screen formatting. Here's the code I'm writing:

5 input "qwhat is the current time (hhmm
ss) ";ti$
10 print chr$(147):print chr$(5)
20 a$ = left$(ti$,2)
25 a$ = a$ +":"
30 a$ = a$ + mid$(ti$,3,2)
35 a$ = a$ +":"
40 a$ = a$ +right$(ti$,2)
50 gosub 200
60 print chr$(19)
70 print "qqqqqqqqqqq]]]]]]]]]]]]]]curre
nt time"
80 print "]]]]]]]]]]]]]]]]";
90 print a$
100 goto 20
200 rem print a box
210 print chr$(19)
220 print "qqqqqqqqqq]]]]]]]]]]]]]UCCCCC
CCCCCCCI"
230 print "]]]]]]]]]]]]]B]]]]]]]]]]]]B"
240 print "]]]]]]]]]]]]]B]]]]]]]]]]]]B"
250 print "]]]]]]]]]]]]]JCCCCCCCCCCCCK"
299 return

This code is also available on GitHub: https://gist.github.com/versluis/0b2ecdd3f39ead5f7ed1ff6839d7ac53

Inspired by David's video, in which he connects an LCD screen to his C64's User Port: https://www.youtube.com/watch?v=vV8FbwobrKY


SUPPORT MY PROJECTS
=====================
https://patreon.com/versluis
https://streamlabs.com/wpguru


LISTEN ON SPOTIFY
=================
3D Podcast
https://open.spotify.com/show/4IIh2WPBMRbjct6wdrGcTH?si=Tb7qVvEeQ2GxHpVjahGZNQ

Tech Podcast
https://open.spotify.com/show/3MSMNOruDorce08roxUy85?si=63KfmlDFTT-U1HzpNaa8pw







Tags:
Commodore
64
C64
BASIC
C128