Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:30 26 Oct 2025 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 : VGAclocks Designer

Author Message
dddns
Guru

Joined: 20/09/2024
Location: Germany
Posts: 665
Posted: 05:00pm 14 Aug 2025
Copy link to clipboard 
Print this post

Hello :)

I have written an UI to build an analog clock with various elements. All the parameters can be setup with this, at the moment there are 5 designs which can be altered as you like. There are 3 sections for dimensions, colours and the clock hands. Every section can be saved to disk or the whole object as a snapshot.

Once you are finished it can be exported as a running basic program with an empty main loop, or only the DIM statements can be generated.

It runs on a 2350 in any resolution for MODE 1 and 2 and it runs in any MODE with resolution 1024 and above.
The program is too big and cannot be loaded from disk in Resolution 800 or 848.

Please test it and leave a comment what you think.





VGAcD.zip
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1581
Posted: 07:39pm 14 Aug 2025
Copy link to clipboard 
Print this post

Well it's about time  

I'll show myself out.
 
dddns
Guru

Joined: 20/09/2024
Location: Germany
Posts: 665
Posted: 12:59pm 15 Aug 2025
Copy link to clipboard 
Print this post

To generate a runtime, a copy of "VGAcD.bas" needs to be on root of A: drive.

The extract will run on RP2040 with ILI9341 or with OPTION LCD320 ON on all others:




 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 710
Posted: 03:00pm 15 Aug 2025
Copy link to clipboard 
Print this post

Hello

Impressive and very useful! Thank you for sharing this!

Greetings
Daniel
 
dddns
Guru

Joined: 20/09/2024
Location: Germany
Posts: 665
Posted: 08:32pm 15 Aug 2025
Copy link to clipboard 
Print this post

Nice to hear that you find it useful! :)

I've corrected a small issue and now the runtime contains some lines of demo code how to use it as a gauge:


edit:
I removed the old zip, this is the new one. Switching between Modes works now correct.
VGAcD.bas.zip
Edited 2025-08-16 09:46 by dddns
 
dddns
Guru

Joined: 20/09/2024
Location: Germany
Posts: 665
Posted: 12:06am 19 Aug 2025
Copy link to clipboard 
Print this post

Hello,

I have reworked and optimized it and now the scrolling is faster and very responsive.
One loop takes about 100ms so the cursor will move 10 rows per second.
Except that few values can get out of bounds it runs error free for me so far, please test it.
VGAcD.bas.zip
 
dddns
Guru

Joined: 20/09/2024
Location: Germany
Posts: 665
Posted: 02:09pm 25 Aug 2025
Copy link to clipboard 
Print this post

Hello :)

I have written the routines for:
- adding a corner to a hand. Corner is inserted below the cursor position and is a copy  
 of it. A pitch can be set which will be added to the new coordinate so you can set  
 them in a row.
- deleting a corner
- visualizing the corner of the current cursor position with a marker
- displaying a grid

All other routines are reworked and error handling is done.
The extracted dim's need to have the drawing library which needs to be installed first and is included in the zip.


VGAcD.zip




 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 710
Posted: 03:38pm 25 Aug 2025
Copy link to clipboard 
Print this post

  dddns said  Nice to hear that you find it useful! :)

I've corrected a small issue and now the runtime contains some lines of demo code how to use it as a gauge:


edit:
I removed the old zip, this is the new one. Switching between Modes works now correct.
VGAcD.bas.zip


I love the idea of using this as gauge! But I have truble finding the examples in the program. Could you please point me, to where I can test this function? But this is grown to a really useful and great program!    

P.S.: I am using the HDMI version of the Pico and it works great!

Greetings
Daniel
Edited 2025-08-26 01:39 by Amnesie
 
dddns
Guru

Joined: 20/09/2024
Location: Germany
Posts: 665
Posted: 04:37pm 25 Aug 2025
Copy link to clipboard 
Print this post

Hello Amnesie,

thanks for your reply!

I have tested it in every resolution with VGA and HDMI firmware. It runs almost in every resoltion there is and fonts still fit and dimensions are kept. Please try it in Resolution 1280 and Mode 3 which looks not too bad. Of cause it looks best in Resolution 800 Mode 3, but this is only possible with PSRAM..

How to use it as a gauge you can see, when you create a runtime.
At the beginning you will find a line:
dim integer gflag = 0 'set to 1 to use gauge mode


Set it to 1 and follow the next lines of code and see how to set the value and the labels and gauge scale.

In order to create a runtime version of a clock, the file VGAcD.bas must reside on disk.
Best you create a subdirectory on A: or B: and change into it with chdir. Then copy VGAcD.bas to it and start it from that directory. All files config will be read and written from/to this and you don't have a mess in the root directory
Edited 2025-08-26 02:44 by dddns
 
dddns
Guru

Joined: 20/09/2024
Location: Germany
Posts: 665
Posted: 11:12pm 11 Sep 2025
Copy link to clipboard 
Print this post

Hello :)

I have added the last features I wanted and wrote the routines.
That's why I have rewrote and sorted have of it. But that makes a nice difference and gain in speed. An average design takes about 100ms and even in MODE 3 800x600 it never exceeds 200ms even if overloaded with items. 3,6,9 and 12 can be individual now. All polygons have a build mode and can be triangle, box, 8corner or 14 corner. Also it can be a circle with alignment or a combination. This shows all possibilities, don't laugh :)


- all menus have page numbers
- removed all string operations in the drawing routine
- shorted and renamed all variables
- cursor speed increases after 2sec when changing a value

Can't remember all changes but I think it runs pretty ok now. I think some rework and it's done so far. At the moment it runs only up to Resolution 800 without PSRAM but I have an idea how to solve it.


VGAcD1.zip
Edited 2025-09-12 09:12 by dddns
 
dddns
Guru

Joined: 20/09/2024
Location: Germany
Posts: 665
Posted: 04:15pm 17 Sep 2025
Copy link to clipboard 
Print this post

Hello!

I turned everything upside down and rewrote large parts.
The data lines are removed and everything is now loaded from disk.
If a clock is changed and stored this is now permanent when reloaded.
All data gets now assembled just in time and is soured from configuration files.

VGAcD_disk.zip
Edited 2025-09-18 02:16 by dddns
 
dddns
Guru

Joined: 20/09/2024
Location: Germany
Posts: 665
Posted: 08:50pm 17 Sep 2025
Copy link to clipboard 
Print this post

I forgot to rename some variable names and there were some, which were shown in the list but should not be there. As this regards the major dimension list, all files need to be replaced with the ones in this archive. Sorry, but better now..

VGAcD_disk1.zip
 
dddns
Guru

Joined: 20/09/2024
Location: Germany
Posts: 665
Posted: 03:50pm 20 Sep 2025
Copy link to clipboard 
Print this post

Hello :)

One of my goals was, to have clear variable names and not cryptic multi dimensional arrays as the runtime extract is my focus. A second one was to have all these variables manageable as easy and clear as possible.
I needed the program space to realize all of that while still fitting into internal editor as this is my preferred debugging tool. It must not exceed 95Kb so the step to convert it into disk-based was necessary. With the gained space I did some roundups
and have added another way to setup the polygons for the hands. and that is symmetrical. Symmetrical built hands have an even number of corners and the coordinates are set paired/mirrored. That makes it much easier:

I've set the pitch to 5 pixel and created 15 pairs of corners. Then the constrution helper circle can be use to align all these corners row by row at the circle:



this is a bit sloppy but can be done pretty accurate






VGAcD_disk3.zip


I orientated myself on this  and never looked for more. I haven't worn a watch for 30 years :))
Edited 2025-09-21 02:22 by dddns
 
dddns
Guru

Joined: 20/09/2024
Location: Germany
Posts: 665
Posted: 12:51pm 22 Sep 2025
Copy link to clipboard 
Print this post

Hello!

To make it easier to have nice round shaped hand I implemented a auto-align mode.
All coordinates within the construction circle are automatically aligned but only in symmetrical mode. You can adjust the position in y and the radius. If the coordinates are set in a row with a pitch of 5 pixel, the circle looks good as can be.
This example is done with 20 pairs of coordinates but I've tested 72 cornered polygons which also work very nice.



Also many corrections and polishing including the designs itself.

VGAcD.zip

Have fun!
 
dddns
Guru

Joined: 20/09/2024
Location: Germany
Posts: 665
Posted: 03:12pm 23 Sep 2025
Copy link to clipboard 
Print this post

I have finished it. The last things I did was to have the config of the program also read and written from/to disk. So if one of the config files is missing this won't start at all. But now all settings are saved and the next restart will come up with last parameters.
Now a clock can be added and erased from the available configs. It will always be appended to to list and only the last in list can be erased.

I tested up and down and for me it runs completely error free now. Only some values can still be set outer bounds and will crash it but the regular functionality is completely ok for me.

Please create a subdir on A: or B: and copy all files from the zip to that dir.
Then use "drive" and "chdir" commands and start it from here.

VGAcD_V1.zip
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5367
Posted: 06:58am 24 Sep 2025
Copy link to clipboard 
Print this post

Hi dddns,

Played with your V1 version a bit. Impressive how configurable this is. It could think this is a nice challenge for the forum "Who designs the nicest clock".

I used your version on a 2350VGA platform with PSRAM.

During my experiments I was able to surface a bug. See photo. Some of the hour markers are drawn into the menu, and are not erased anymore. Not even when you exit the menu. See the yellow circles in the menu.



Thanks for this nice program.

Volhout
Edited 2025-09-24 16:59 by Volhout
PicomiteVGA PETSCII ROBOTS
 
dddns
Guru

Joined: 20/09/2024
Location: Germany
Posts: 665
Posted: 10:21am 25 Sep 2025
Copy link to clipboard 
Print this post

Hello Volhout,

many thanks for testing and your feedback.
I´m aware that all markers and the numbers can be set with their offset out of bounds of the drawing area. If the menu is redrawn when something is printed in this area then a flickering effect will happen which looks not nice. This would happen within the same frame and thus also with framebuffer.
I was not sure in the beginning how to best handle it and in the end I forgot..
I think the best solution is whether not to print the affected labels and this would be not easy to do. Or to scale down the rest according to the radius the most outside positioned label resides on..
 
dddns
Guru

Joined: 20/09/2024
Location: Germany
Posts: 665
Posted: 02:37pm 26 Sep 2025
Copy link to clipboard 
Print this post

Hello!

Having the numbers beyond the face radius can be stylish as well as having the hour markers as 14 corners and the width so large, that they touch each other. If you set it beyond  the face, it can be a very nice decoration, the circles too. So all of those are valid style elements and I will definitely try to care.

I started with this as HDMI was in a extreme hype but came from ssd1963 LCD as main console. So my first try at the beginning was to get a nice graphic on LCD and I never forgot.

Everyone who is interested please try to run the extract on a LCD no matter what resolution. It should run, if you comment out the MODE and the TILE lines.
With PSRAM, even the designer should run. Please give it a try!

Please experiment with OPTION LCD320
Edited 2025-09-27 00:44 by dddns
 
dddns
Guru

Joined: 20/09/2024
Location: Germany
Posts: 665
Posted: 06:51pm 12 Oct 2025
Copy link to clipboard 
Print this post

Good evening!

I have rewritten large parts of it. All static data is now read and written to/from disk and that works very nice and fast. The way polygons are setup is now easier to handle. No object can draw beyond the menu line any more. With space the page can be turned and with F3, dimension and colour and a single hand can be imported from any existing.
The numbers and text can have auto scale now with every font, Font9 is included.
I've update the designs and there are 11 now to have a start with. The performance is increase and I took care, that really only code what is necessary is executed. The hand can have up to 62 corners.

This is still a test version. So please have fun and test it :)
VGAcD_new.zip




Edited 2025-10-13 04:52 by dddns
 
Print this page


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

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025