Ahh, an hourly chime, I didn’t think of that (and of course it did not run long enough to have the chime go off.) Thanks.
Nice clock, @sweacco!
Since I “needed” the second hand, I added the use of framebuffer to avoid flickering.
' Clock for PicoCalc MMBasic
CLS
'=== present time
Dim hh As integer
Dim mm As integer
Dim ss As integer
'=== parameters of clock hands
Const x0=160
Const y0=160
Const lh=70
Const lm=130
Const ls=130
Const l_=-10
Const th=-8
Const tm=-3
Const ts=-1
'=== draw clock hands
Sub DrawHour hour%,minute%,second%,c%
hour_=hour%+minute%/60.0+second%/3600.0
theta=Pi/6.0*hour_
Line x0+l_*Sin(theta),y0-l_*Cos(theta),x0+lh*Sin(theta),y0-lh*Cos(theta),th,c%
End Sub
Sub DrawMinute hour%,minute%,second%,c%
minute_=minute%+second%/60.0
theta=Pi/30.0*minute_
Line x0+l_*Sin(theta),y0-l_*Cos(theta),x0+lm*Sin(theta),y0-lm*Cos(theta),tm,c%
End Sub
Sub DrawSecond hour%,minute%,second%,c%
theta=Pi/30.0*second%
Line x0+l_*Sin(theta),y0-l_*Cos(theta),x0+ls*Sin(theta),y0-ls*Cos(theta),ts,c%
End Sub
'=== parameters of clock face
Const l1=150
Const l2=140
Const t1=-2
Const t2=-4
'=== draw clock face (numbers)
Sub DrawClockFace
Font 3
Color RGB(white)
For i=1 To 12
Text x0+l2*Sin(Pi/6.0*i),y0-l2*Cos(Pi/6.0*i),Str$(i),cm
Next i
End Sub
'=== draw clock face (markers)
Sub DrawClockFace2
'1,2,4,5,7,8,10,11
For i=1 To 10 Step 3
x=Sin(Pi/6.0*i)
y=Cos(Pi/6.0*i)
Line x0+l1*x,y0-l1*y,x0+l2*x,y0-l2*y,t1,RGB(grey)
Line x0-l1*x,y0-l1*y,x0-l2*x,y0-l2*y,t1,RGB(grey)
Next i
'3,9,6
Line x0+l1,y0,x0+l2,y0,t2,RGB(grey)
Line x0-l1,y0,x0-l2,y0,t2,RGB(grey)
Line x0,y0+l1,x0,y0+l2,t2,RGB(grey)
'12
Line x0+t2,y0-l1,x0+t2,y0-l2,t2,RGB(grey)
Line x0-t2,y0-l1,x0-t2,y0-l2,t2,RGB(grey)
End Sub
'=== draw new clock hands
Sub DrawClockHands
DrawHour hh,mm,ss,RGB(lightgrey)
DrawMinute hh,mm,ss,RGB(lightgrey)
DrawSecond hh,mm,ss,RGB(red)
Pixel x0,y0,RGB(black)
End Sub
'=== read Time$
Sub ReadTime
hh=Val(Left$(Time$,2))
mm=Val(Mid$(Time$,4,2))
ss=Val(Right$(Time$,2))
End Sub
'=== time signal (1 shot)
Sub TimeSignal
If mm=0 And ss=0 Then
Play tone 998,1002
Pause 500
Play stop
End If
End Sub
'=== time signal (2 shots)
Sub TimeSignal2
If mm=0 And ss=0 Then
Play tone 2000,0
Pause 70
Play stop
Pause 130
Play tone 2000,0
Pause 70
Play stop
End If
End Sub
'=== clock process
Sub ClockProc
CLS
ReadTime
DrawClockFace2
DrawClockHands
TimeSignal2
FRAMEBUFFER copy f,n
End Sub
'***** MainProgram from here
FRAMEBUFFER create
FRAMEBUFFER write f
ClockProc
SetTick 1000,ClockProc,1
Do While Inkey$ = "":Loop
FRAMEBUFFER close
CLS
A little tool to get the height and width from a bmp file.
width=bmpsize (“testimage.bmp”,“width”)
——— program here ———
Function bmpsize(file$,dimen$)
Open file$ For input As #4
Local trash$,byte1$,byte2$,byte3$,byte4$,a1,a2,a3,a4,width,height
bmp9387_trash$=Input$(18,4)
byte1$=Input$(1,4):a1=Asc(byte1$)
byte2$=Input$(1,4):a2=Asc(byte2$)
byte3$=Input$(1,4):a3=Asc(byte3$)
byte4$=Input$(1,4):a4=Asc(byte4$)
width=a1*256^0+a2*256^1+a3*256^2+a4*256^3
byte1$=Input$(1,4):a1=Asc(byte1$)
byte2$=Input$(1,4):a2=Asc(byte2$)
byte3$=Input$(1,4):a3=Asc(byte3$)
byte4$=Input$(1,4):a4=Asc(byte4$)
height=a1*256^0+a2*256^1+a3*256^2+a4*256^3
If dimen$=“width” Then bmpsize=width
If dimen$=“height” Then bmpsize=height
Close 4
End Function
—-end program ———-
Thank you, @Blixten !
Your improvements made the clock better and helped me learn how to use the frame buffer.
Now that the second hand moves, I wanted a ticking sound, so I made a little modification. Changing the tone frequency or the Pause value alters the sound, so give it a try!
Sub ClockProc
CLS
ReadTime
DrawClockFace2
DrawClockHands
FRAMEBUFFER copy f,n
Play tone 100,100
Pause 1
Play stop
TimeSignal2
End Sub
Hihi, I had the same idea, but I play a recorded tick (WAV-file) from an old grandfather clock, and plan to add the hourly chime(s) as well.
That’s a great idea!
If I find a clock with a nice sound, I’ll try it too.
Work in progress… (Watch VID_20251018_155954 | Streamable)
Nice, it reminds me of the real grandfather clock hanging on the wall in my father’s living room.
@Blixten After running the clock program for a long time, the screen appears to have suffered burn-in.
When using “CLS RGB(128,128,128)”, the faint outline of the dial remains visible.
Please be careful not to leave it running for a long time.
Thanks for the warning
What is a long time in hours?
spitballing without any evidence but i wonder if picomite initializes the lcd with some voltage drive higher than the LCD actually needs, this behaviour would be consistent with that
@Bananzi
The time it was in operation was about ten times for several hours each.
However, in the photo above, the hour hand was around 10 o’clock. After it disappeared once, I moved it for about 10 minutes, and it ended up at 7 o’clock (the clock was pointing to that time). So it might not be burn-in caused by displaying it for a long time.
@maple
I don’t have any knowledge about LCDs, so I can’t really say…
(Since this is straying from the main topic of this thread, if the discussion continues, it might be better to move it somewhere else.)
Sorry for the long response times / lack of. I took a 4 month break due to life wanting to screw me in every way possible, For the first time in about a month I have a solid 24 hours to myself before its interrupted by friends and family. I had to sell my main desktop & my home lab due to my car breaking down 3 total times. I ended up having about a grand left over so I decided to check best buys black Friday sales, I ended up getting an ASUS TUF Gaming F16 (2025) model, I7-14650hx, 32gb DDR5 5600, RTX 5060 8gb. I made some minor upgrades to it like, ditching the crappy ASUS software and going the route of manual fan / power control and installing a gen5 4tb nvme SSD I got at Walmart for $150. Total cost of the laptop & SSD was just under $950.00 USD.
Currently on the chopping block is an app strictly for the Pico 2W, this app is unnamed as of now since I’m not quite sure what to call it. Some of the features include, a signal heatmap, web log interface, connection monitor, and a geiger counter like signal search mode.
Hello MMBasic fans,
i wrote a program for the game “Connect Four” or the german “4 gewinnt”.
I used MMBasic V6.00.03
You can download the english or german versin in my Github:
I have also created a German version of Wordle.
It is based on the program by William M. Leue from the BackShed Forum. I provided the translation, the German Word file, and the adaptation to picocalc. Tested with V6.00.03.
German Wordle?
dude, are there even any 5 letter German words?
I know we are the world champions in creating monster words, like “Donaudampfschifffahrtselektrizitätenhauptbetriebswerkbauunterbeamtengesellschaft.” (Danube Steamship Company Electricity Main Operating Depot Construction Subordinate Officials Association)
But there are even words with only 5 letters.
I would reply to the poster with a rude 5 letter word that starts with “A” and ends with “rsch”. ![]()
“Popo” hast only 4 letters and “Hintern” maybe 7….
