|
Forum Index : Microcontroller and PC projects : ASTROMITE
| Author | Message | ||||
| cdeagle Senior Member Joined: 22/06/2014 Location: United StatesPosts: 266 |
This post describes a portable interactive astronomy calculator using MMBASIC and the Pico Waveshare 2.8 inch display/SD module. Here's a picture of the ASTROMITE main menu. ![]() Here are two pictures of typical ASTROMITE input screens. ![]() Here is a picture of a typical ASTROMITE output screen. ![]() The main menu resides in flash slot 1. Each application resides in its own individual flash slot. The MMBASIC software for each application has been posted here previously. The input and output of each program was modified for a touch screen. After an application completes its calculations it returns control to the main menu. An observer's coordinates are stored in a simply ASCII file called observer.dat on the companion SD card. Here's an example for Cape Canaveral, Florida USA. ************************************ * observer data file For AstroMite * * Cape Canaveral, Florida * ************************************ observer geodetic latitude(degrees, minutes, seconds) (-90 degrees <= latitude <= +90 degrees, positive north, negative south) 28, 23, 45 observer geographic longitude(degrees, minutes, seconds) (-180 <= degrees <= +180 degrees; positive east, negative west) -80, 35, 55 observer geodetic altitude(meters; positive above sea level) 4 Here's the MMBASIC source code that opens and reads the observer data file. ''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''' Sub observer(obslat, obslong, obsalt) ' read observer latitude, longitude and altitude subroutine ' output ' obslat = latitude (radians) ' obslong = longitude (radians) ' obsalt = altitude (meters) '''''''''''''''''''''''''''''' Open "observer.dat" For input As #1 ' read 15 lines of information For i% = 1 To 7 Line Input #1, rem_string$ Next i% ' latitude Input #1, obslat_deg, obslat_min, obslat_sec For i% = 1 To 3 Line Input #1, rem_string$ Next i% ' longitude Input #1, obslong_deg, obslong_min, obslong_sec For i% = 1 To 2 Line Input #1, rem_string$ Next i% ' altitude Input #1, obsalt Close #1 obslat.deg$ = Str$(obslat_deg) If (Left$(obslat.deg$, 2) = "-0") Then obslat = -dtr * (obslat_min / 60.0 + obslat_sec / 3600.0) ElseIf (Val(obslat.deg$) = 0.0) Then obslat = dtr * (obslat_min / 60.0 + obslat_sec / 3600.0) Else term1 = Sgn(Val(obslat.deg$)) term2 = Abs(Val(obslat.deg$)) obslat = dtr * term1 * (term2 + obslat_min / 60.0 + obslat_sec / 3600.0) EndIf obslong.deg$ = Str$(obslong_deg) If (Left$(obslong.deg$, 2) = "-0") Then obslong = -dtr * (obslong_min / 60 + obslong_sec / 3600) ElseIf (Val(obslong.deg$) = 0.0) Then obslong = dtr * (obslong_min / 60.0 + obslong_sec / 3600.0) Else term1 = Sgn(Val(obslong.deg$)) term2 = Abs(Val(obslong.deg$)) obslong = dtr * term1 * (term2 + obslong_min / 60.0 + obslong_sec / 3600.0) EndIf End Sub |
||||
| Calli Regular Member Joined: 20/10/2021 Location: GermanyPosts: 74 |
Great! (I did not flip my monitor up-side-down :) |
||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2832 |
Everything looks like that in the antipodes. |
||||
| Lou Senior Member Joined: 01/02/2014 Location: United StatesPosts: 229 |
Very easy to read, I just stand on my head. ![]() Microcontrollers - the other white meat |
||||
| greybeard Senior Member Joined: 04/01/2010 Location: AustraliaPosts: 175 |
In space with zero gravity there is no up or down |
||||
| Calli Regular Member Joined: 20/10/2021 Location: GermanyPosts: 74 |
made my day. |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8297 |
Don't you just love the part of the JPG standard, specifying how the image rotation bits are used, that is so freely ignored by phone manufacturers? Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
| Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 1000 |
PHANTASTIC!!! @cdeagle: ...is this really the full code? Frank |
||||
| cdeagle Senior Member Joined: 22/06/2014 Location: United StatesPosts: 266 |
Anyone know how to import photos without standing on your head? They look fine on my computer. @Frank ... no, just the code that reads the observer coordinates. Each application is many lines of MMBASIC code. |
||||
| Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 1000 |
@cdeagle: Would you provide the complete code here? THANKS!!! Frank |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8297 |
@cdeagle You may have to load them into a photo editor and re-save them. In theory the editor will overwrite the rotation bits to the current rotation as it saves. Don't worry too much - this is a really common problem (although, admittedly, I've not seen it on this particular forum before). My favourite free photo editor is PhotoFiltre 7. It's really good! And IrfanView to view pictures. Deceptively powerful. :) Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
| cdeagle Senior Member Joined: 22/06/2014 Location: United StatesPosts: 266 |
Thanks Mick. I'll check them out. I'm currently using Microsoft Photos which could explain the problem. |
||||
| cdeagle Senior Member Joined: 22/06/2014 Location: United StatesPosts: 266 |
Attached are photos that don't require standing on your head or turning your monitor 180 degrees. Re-saving with PhotoFiltre 7 did the trick. ![]() ![]() ![]() |
||||
| cdeagle Senior Member Joined: 22/06/2014 Location: United StatesPosts: 266 |
Attached is a zip archive of MMBASIC source code for ASTROMITE. Note that I have commented out the return to the main menu from each application. This allows each application to run stand-alone. ' return to main menu ' Flash run 1 astromite.zip |
||||
| Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 1000 |
Thank you very, very much!!! Frank |
||||
| Plasmamac Guru Joined: 31/01/2019 Location: GermanyPosts: 596 |
Thx a lot Plasma |
||||
| panky Guru Joined: 02/10/2012 Location: AustraliaPosts: 1116 |
Hi cdeagle, In adapting your programs to run in a 'console mode', I discovered that in moon_phases.bas you use a variable ls. In CMM2 and in Tom's new mmbasic for linux, ls is a system command and thus unavailable for use in a program as a variable. Renamed this variable and all worked as intended. All your great programs work under mmb4l. Cheers, Doug. ... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it! |
||||
| cdeagle Senior Member Joined: 22/06/2014 Location: United StatesPosts: 266 |
Good to hear Doug. All of these astronomy programs for console mode are available on TBS. |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |