Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:56 19 Nov 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 : ASTROMITE

Author Message
cdeagle
Senior Member

Joined: 22/06/2014
Location: United States
Posts: 266
Posted: 04:17pm 04 Nov 2021
Copy link to clipboard 
Print this post

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: Germany
Posts: 74
Posted: 04:35pm 04 Nov 2021
Copy link to clipboard 
Print this post

Great!

(I did not flip my monitor up-side-down :)
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2832
Posted: 12:01am 05 Nov 2021
Copy link to clipboard 
Print this post

Everything looks like that in the antipodes.
 
Lou

Senior Member

Joined: 01/02/2014
Location: United States
Posts: 229
Posted: 03:47am 05 Nov 2021
Copy link to clipboard 
Print this post

Very easy to read, I just stand on my head.  
Microcontrollers - the other white meat
 
greybeard
Senior Member

Joined: 04/01/2010
Location: Australia
Posts: 175
Posted: 03:57am 05 Nov 2021
Copy link to clipboard 
Print this post

In space with zero gravity there is no up or down  
 
Calli
Regular Member

Joined: 20/10/2021
Location: Germany
Posts: 74
Posted: 07:01am 05 Nov 2021
Copy link to clipboard 
Print this post

  greybeard said  In space with zero gravity there is no up or down  


made my day.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8297
Posted: 07:47am 05 Nov 2021
Copy link to clipboard 
Print this post

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: Germany
Posts: 1000
Posted: 07:58am 05 Nov 2021
Copy link to clipboard 
Print this post

PHANTASTIC!!!    

@cdeagle: ...is this really the full code?

Frank
 
cdeagle
Senior Member

Joined: 22/06/2014
Location: United States
Posts: 266
Posted: 08:50am 05 Nov 2021
Copy link to clipboard 
Print this post

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: Germany
Posts: 1000
Posted: 09:05am 05 Nov 2021
Copy link to clipboard 
Print this post

@cdeagle: Would you provide the complete code here? THANKS!!!

Frank
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8297
Posted: 10:02am 05 Nov 2021
Copy link to clipboard 
Print this post

@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 States
Posts: 266
Posted: 12:30pm 05 Nov 2021
Copy link to clipboard 
Print this post

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 States
Posts: 266
Posted: 04:06pm 05 Nov 2021
Copy link to clipboard 
Print this post

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 States
Posts: 266
Posted: 04:12pm 05 Nov 2021
Copy link to clipboard 
Print this post

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: Germany
Posts: 1000
Posted: 06:14pm 05 Nov 2021
Copy link to clipboard 
Print this post

Thank you very, very much!!!      

Frank
 
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 596
Posted: 07:51am 06 Nov 2021
Copy link to clipboard 
Print this post

Thx a lot
Plasma
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1116
Posted: 10:24pm 07 Nov 2021
Copy link to clipboard 
Print this post

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 States
Posts: 266
Posted: 09:55am 08 Nov 2021
Copy link to clipboard 
Print this post

Good to hear Doug. All of these astronomy programs for console mode are available on TBS.
 
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