Sun position example

I refer to the sun position example in arduino. How can you change the coding in that sketch to use the RTC ds3231? It looks like that example is using the time the program has been running.
If you are using a RTC you would need to fill in the sketch for the date and time. Can anybody show a sun position sketch using the time and date input from the 3231?
I used a reference from the internet called 'the suns position -PVE education' to make my own sketch for the suns position. Then to get the elevation and azimuth I had to put in the serial monitor my time and the number of days since JAN 1. This sketch got very complicated, but it works. You really need a library.
I know it is accurate from an app on the internet which give the suns position for your position on the globe,

Google arduino example D32312.
Try.
If it works, add it to your code...

Thar i fexid it.

How do you expect to get help with your code if you do not post your code?

1 Like

Check his other posts...

Hi, @petercl14

Is this just an exercise, or do you have a use for the code?

Thanks.. Tom.. :smiley: :+1: :coffee: :australia: