Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 06:08 22 Jan 2022 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
Newbie

Joined: 09/01/2022
Location: United Kingdom
Posts: 5
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
Newbie

Joined: 09/01/2022
Location: United Kingdom
Posts: 5
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: 582
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
 
Print this page


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

© JAQ Software 2022