Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 15:53 30 Sep 2023 Privacy Policy
Jump to

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.

Forum Index : Microcontroller and PC projects : Picomite Super Clock

Author Message
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1684
Posted: 09:46pm 13 Sep 2023
Copy link to clipboard 
Print this post

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
  Quote  Invalid address - resetting
.
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 Kingdom
Posts: 7773
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: Australia
Posts: 1684
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 States
Posts: 169
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 NPHighview
Live in the Future. It's Just Starting Now!
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1684
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"
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2023