Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 10:24 25 Apr 2024 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 Solar System Clock

Author Message
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 411
Posted: 05:35pm 10 Jan 2022
Copy link to clipboard 
Print this post

I have converted a Python Solar System project which uses the planetry equations of motion to run on MMBasic or PicoMite.
Apart from the hair raising maths, this was amazingly easy. :-)
My set up uses the exact set up shown for a LCD screen in the PicoMite user manual, with the addition of screen brightness on GP10.
I have used the touch screen to allow screen brightness changes and to fast scroll through weeks/months of planetary motion.
I have limited the year to between 1901 and 2100 as the equations referenced imply they are inaccurate beyond 2100.
Touch points are :-
Top Left = Brightness up
Bottom Left = Brightness down
Top Right = increase date by a week at a time then a month...
Bottom Right = decrease date by a week at a time then a month...
Centre screen= reset to todays date.

I really only did this to see if it could be done, I haven't used BASIC for 30years and have never used Python! I was very surprised how straight forward it was, probably mainly due to the people who have ported and maintain MMBasic on the Pico. :-)



The attached files are:-
1) the OPTION settings I've used for this and the later Pimoroni screen version.
2) the MMBasic for this version solarsysecs.BAS
3) the MMBasic for the later version using a Pimoroni LCD Display 2.0 & a 3231 RTC solarsyspim.BAS

solarsys.zip
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 411
Posted: 05:36pm 10 Jan 2022
Copy link to clipboard 
Print this post

I subsequently shrunk everything using a Pimoroni LCD Display 2 This is a very neat and sharp display, which simply plugs directly on to the pins of a Pico, so making it very compact, I also added a DS3231 RTC so you don't have to set the date/time every time, next will be a box.
I have also now added the bouncing Pluto, seconds display, very roughly the height Pluto bounces, is approximately seconds counting down to the next minute, the display animation of Pluto updates at about 10Hz, so is fairly smooth.
Because the Pimoroni display is not a touch screen, I have made the 4 buttons it has, control fast forward/back and brightness.
Top Left button brightness up.
Bottom Left button brightness down.
Top Right button, fast forward the date/solar system.
Bottom Right button, fast reverse the date/solar system.
Both Right hand buttons together, returns to the present date.
As an added feature, when you have fast forward or back the RGB LED will light up faint blue as an indication the date is not current.
You will need to define the GPIO that the display uses for MMBasic, these are in the OPTION file. I have also defined the appropriate pins for an SD, so that the program ca be loaded.







As an example, here is what our solar system looked like when the Voyagers were launched, you can see how the planets were lined up for the grand tour, note the blue LED, indicating that the date is not current, the time remains current.



Out of interest, If you play with different CPU speeds, the fast date scroll runs at about:-
48Mhz 6.5 months forward/back per second.
125Mhz 15 months per second
250Mhz 28 months per second

The solar system positively whirls round. ;-) there's an impressive amount of high precision scientific floating point maths and graphics plotting going on for each month. If you want to see where the planets will be a long time forward or back, I'm afraid you'll have to manually set DATE$. I have confirmed the planets are correctly aligned, so the maths is correct, I even wound it back to September 1977, when the Voyagers launched (above) and sure enough you can see the nice spiral layout of the planets they visited on their grand tour. :-)

Regards Kevin.
Edited 2022-01-11 06:02 by Bleep
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 813
Posted: 08:00am 11 Jan 2022
Copy link to clipboard 
Print this post

Fantastic!!! I have been waiting for this for a long time!!! THANK YOU!!!
   

Frank
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 411
Posted: 02:22pm 24 Jan 2022
Copy link to clipboard 
Print this post

I have now added the Moons orbit around Earth.



I have also added an option flag, if you do or do not have an RTC attached, set rtcl=1 or 0 in the variable initialisation; obviously you will need to set time and date every time you loose power, without the RTC, but it still keeps reasonably good time.
Otherwise everything else is as before, hopefully.
I've used this RTC https://www.ebay.co.uk/itm/154736489893 ... Sw~~ZhrlGc and this SD card module for loading and saving files too/from the Pico https://www.ebay.co.uk/itm/193453320566 ... Sw3lZeyOFY they both work fine. The solarsys.zip file has been updated, see below, with the latest 2 versions of the program, standard and the Pimironi display, along with the MMBasic Options I set.
Regards, Kevin.


solarsys.zip
Edited 2022-01-25 00:25 by Bleep
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 813
Posted: 02:34pm 24 Jan 2022
Copy link to clipboard 
Print this post

Hi Bleep,

thank you very much for sharing!
Does your moon also show the phases of the moon?
Do you think there is much to change to make your program run on an CMM2?

Frank
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5714
Posted: 02:52pm 24 Jan 2022
Copy link to clipboard 
Print this post

This is *so* cool and geeky...
I may have to buy a display just to build one!  :) It would sit nicely on my PicoMite Backpack, although that uses the tiny RTC module.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 411
Posted: 02:22pm 26 Jan 2022
Copy link to clipboard 
Print this post

Hi Frank,
No there are no moon phases, mainly because the moon is only about 5 pixels in diameter, so it would be a bit pointless. It's very easy to work it out though, just assume you are directly below the moon, on Earth, then look at where the sun is; so for the above photo it is just before half moon, I would estimate it would be half moon a couple of days on from 24th Jan.
No idea about running on CMM2, try it and fix the errors.
Regards, Kevin.
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 813
Posted: 09:49am 28 Jan 2022
Copy link to clipboard 
Print this post

@Bleep:

Thanks for your info - I will try it out when the opportunity arises...

Frank
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1985
Posted: 12:39pm 28 Jan 2022
Copy link to clipboard 
Print this post

  Bleep said  
I have also added an option flag, if you do or do not have an RTC attached, set rtcl=1 or 0 in the variable initialisation


How about making it auto-configure:


rtcl=0
On Error Skip 2
RTC GetTime
rtcl=1
'we jump to here if no RTC found leaving the flag at 0
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 411
Posted: 07:09pm 28 Jan 2022
Copy link to clipboard 
Print this post

Thanks, I'll give that a go.
Regards Kevin
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 411
Posted: 04:40pm 18 Feb 2022
Copy link to clipboard 
Print this post

Finished 3.5" Raspberry Pi touch display, attached to a Pico, & RTC, in a perspex case that came with the display, Display on Ebay.
Many thanks to Peter for PicoMite and pointing me in the correct direction for connecting the diplay and the fact that even though it was a ILI9486, the PicoMite  ILI9481 driver worked fine, which it does. :-)  Because I got the back screen brightness working I have also done automatic brightness, depending on time of year and time of day, it can be overriden with the touch screen brightness control.
Thanks to all involved,
Regards, Kevin.
solarsys.zip




 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 813
Posted: 10:06am 19 Feb 2022
Copy link to clipboard 
Print this post

Hi Kevin,

thank you very much for your 480x320 version!  

Frank
 
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 501
Posted: 03:49pm 19 Feb 2022
Copy link to clipboard 
Print this post

Like it
Plasma
 
Print this page


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

© JAQ Software 2024