Calculate the position of the Moons of Jupiter
Arduino is a powerful tool for programming and interfacing with hardware. But, it is also a powerful programmable computer with a built in ability to use your computer keyboard and display as input and output. Let's take advantage of this by writing a program that calculates the position of Jupiter's moons and displays it on the Serial monitor included with the Arduino IDE.
This program gives the estimated positions for the 4 major Jupiter moons. It is meant to use the Serial Monitor as interaction, but also uses an LCD shield to display the results of calculations. The program starts by asking for desired date and time. Make sure in the Serial Monitor that you have choosen 'Newline' in the dropdown box on the bottom of the window. Enter the year as a 4 digit integer. Enter the month as a 1 or 2 digit integer number. Enter the day as a decimal number adjusted to universal time (add or subtract your time zone to get UT - the time at the prime meridian). Convert your local time to a decimal day by dividing by 24. For instance, 6:00am on 5 March UT would be a decimal day of 5.25. The result is the calculation of the distance from Jupiter in Jupiter radii of the 4 moons. It then shows a graphical representation of the layout to help you better visualize the orientation. The program also assumes you are looking through a telescope, so it will appear backwards to those viewing with binoculars or the naked eye.
Download the code here:
Download the code and load it into the Arduino IDE. Select the correct board and download the program. Open the Serial Monitor and select 'NEWLINE' in the lower right dropdown box. Enter the year as a 4 digit value. Enter the Month as a 1 or 2 digit value. Finally, enter the day as a floating point value with the whole day and fraction (i.e. 14.5 for 12pm on the 14th). The program will calculate the positions, and display them. It will then show a graphical representation of what the moon configuration looks like with respect to Jupiter. The program will also print out the positions on an attached LCD shield.