Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
I am trying to get Geoff's super clock to run on a Pico. All is good, except when I try to select an analogue clock. I get an error . Is this something to do with trying to draw triangles for the hands, and is there a fix or I just do away with analoge clocks. I am using 5.07.08b15"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
matherp Guru
Joined: 11/12/2012 Location: United KingdomPosts: 8964
Posted: 06:09am 14 Sep 2023
Copy link to clipboard
Print this post
Geoff's code uses a PIC32 Cfunction to draw triangles. This cannot run on a ARM processor. However, the PicoMite has an inbuilt triangle command so you just need remove the Cfunction and re-code using the in-built command
palcal
Guru
Joined: 12/10/2011 Location: AustraliaPosts: 1860
Posted: 06:33am 14 Sep 2023
Copy link to clipboard
Print this post
Thanks Peter, sounds like it's a bit beyond my coding ability but Ill have a look."It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
NPHighview
Senior Member
Joined: 02/09/2020 Location: United StatesPosts: 198
Posted: 12:53am 15 Sep 2023
Copy link to clipboard
Print this post
If you're using a PicoW, you may like this code: https://github.com/sfjohnso/PicoW/blob/main/AnalogClock.bas
It uses Peter's PicoMite triangle code.
This uses the Waveshare Pico-Eval-Board but could easily be adapted for other displays by modifying the CONST values at the beginning. It uses the P-E-B's on-board "clicker" to quietly, but audibly, tick every second.
You need to set up access to your WiFi via OPTION command, and set the display to Portrait (I use Portrait-Reversed to make the USB cable come out close to the desktop). In the code, you may need to hard-code the time-zone offset from Universal Coordinated Time (it's currently set to work for me near Los Angeles).
If it doesn't find your access point or an NTP server (to begin with, and once per hour), it'll use locally-set (i.e. via command line) time and date, and indicate (using a stick figure) that time is manual. If it's successful in picking up NTP, then it displays a "computer" figure.
The clock face is my crude attempt to emulate Swiss railroad clocks, but show a "ticking" second hand instead of a sweep second hand. You can change hand lengths and colors by modifying the CONST values. Edited 2023-09-15 11:06 by NPHighviewLive in the Future. It's Just Starting Now!
palcal
Guru
Joined: 12/10/2011 Location: AustraliaPosts: 1860
Posted: 04:23am 15 Sep 2023
Copy link to clipboard
Print this post
Thanks for that, I will look into it more later, I may have a use for it. But I don't really want to use this clock as an analogue clock. I use the digital clock but if some one tries to set the clock to analogue it stops with an error and because the settings are saved with Var Save, when you try to restart the clock it tries to start in alanogue mode and fails. I have found a work around, just can't use the analogue function. Thanks Paul."It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
crazycloud Newbie
Joined: 20/08/2023 Location: United StatesPosts: 37
Posted: 02:47pm 01 Jan 2024
Copy link to clipboard
Print this post
Hello NPHighview
I wanted to thank you for the clock program. I ordered a Waveshare Pico Eval Board a full year ago. I just got it working with your clock program. Its an awesome way to check out all the features of the board. I like it so much I ordered a 2nd one. they are a little pricey but worth it. What else have you done with it?
Best Regards
Jim, crazycloud
NPHighview
Senior Member
Joined: 02/09/2020 Location: United StatesPosts: 198
Posted: 03:53pm 01 Jan 2024
Copy link to clipboard
Print this post
Hi, crazycloud! Thanks for the compliment. I've been using WaveShare boards for a while now, as I like their integration and don't really have the facilities to fabricate my own. The main disadvantage of the P-E-B is that it lacks pin-outs for accessing other I/O.
I've written "picoscope" code for a smaller format WaveShare board; you can find my article about it in the most recent "MAKE:" magazine.
I've also written some "lissajous" graphics code for the Waveshare P-E-B, as well as a version of Conway's Game of Life that takes advantage of Tassy Jim's excellent "wraparound" code.
I hope you are enjoying the Forum as well. I've been helped a lot by this community in my MMBasic programming endeavors and hope you will be, too.
- Steve, NPHighviewLive in the Future. It's Just Starting Now!
crazycloud Newbie
Joined: 20/08/2023 Location: United StatesPosts: 37
Posted: 03:59pm 01 Jan 2024
Copy link to clipboard
Print this post
Hi Steve
I'll have to try your other code. An oscilloscope program sounds intriguing. I've been fooling around with the midi / mp3 board for sound experiments. This winter I want to hook up the pico to a midi keyboard and play sounds on the VS1053. It we be a "poor man's synthesizer"
The folks on the forum have been a great help when I have questions.