cosinekitty / astronomy

Astronomy Engine: multi-language calculation of Sun, Moon, and planet positions. Predicts lunar phases, eclipses, transits, oppositions, conjunctions, equinoxes, solstices, rise/set times, and other events. Provides vector and angular coordinate transforms among equatorial, ecliptic, horizontal, and galactic orientations.
MIT License
496 stars 64 forks source link

Add Arduino to astronomy Engine #360

Closed DannyRavi closed 3 months ago

DannyRavi commented 3 months ago

Hi @cosinekitty .This week, I worked on converting C Project "Astronomy Engine" codes to Arduino, and I was able to run and test the codes on a Raspberry Pi 2040, and I compared the results with the C codes of this program and observed a perfect match. Next, I want to test the program on other micro-controllers that support Arduino, such as ESP32 and STM32 and others. I suggest that we create a new repository so that we can add the code to the Arduino Library Manager in this and activate Process "CI" in that repository. What do you think about this?

cosinekitty commented 3 months ago

I'm glad you are able to get the C code working in the Arduino environment. I don't know that I could maintain a separate Arduino repository myself because it would be difficult to figure out how to automate the testing. If you would like to fork the Astronomy Engine repo and support it for Arduino, that would be fine with me. I do not anticipate a lot of changes in the near future, so keeping them in sync should be easy, just by monitoring this repo and picking up changes as needed. What do you think?

DannyRavi commented 3 months ago

There is a tool called "Arduino Cli" that can test and compile Arduino codes and I used it here. Also, some astronomy programs have been written for Arduino in the past, which are: https://plefunga.nathancarter.repl.co/projects/astrocalcs/ https://github.com/DavidArmstrong/SiderealObjects https://github.com/DavidArmstrong/SiderealPlanets https://github.com/natnqweb/SkyMap Also, I would be happy to help maintain or develop the Arduino and Golang (as I said before) part.

cosinekitty commented 3 months ago

I merged this PR into the arduino branch. I also updated all the copyrights to 2024 so that the automated tests will pass (it will fail if any files are modified after the tests run, and part of the tests is to update the copyrights).

Is it possible to submit a URL that points to this arduino branch to the Arduino library repository list? If so, you could just continue to work in this side branch for the time being and I will keep merging into it for you.

DannyRavi commented 3 months ago

Hi @cosinekitty, I think Arduino libraries have a special structure. similar to the following structure: ├── examples │   └── lib1.ino │   └── lib2.ino ├── keywords.txt ├── library.properties ├── LICENSE ├── README.md └── src │   └──lib.cpp │   └── lib.h

Of course, I think that a separate branch can be introduced as Arduino library repository, but in this project there are codes unrelated to the Arduino library, such as Python and Kotlin and others.

For the Arduino CI process, it can be operated in any repository like new repository for" Arduino astronomy Engine" or this repo "astronomy Engine".