Sunrise/sest calculatins - maths.library - stuck.

Sorry folks, but I'm stuck with this one.

I'm wanting to calculate sunrise/set times for some projects.
Given the position isn't changing, that is one thing I don't have to worry about.
It will be "set and forget".

I did a search and found a "sunrise" library and downloaded it.
http://www.swfltek.com/arduino/sunrise
I loaded one of the included example sketches but I got an error.
Maths.h not found.

Going on, I started to search for maths.library (or .h) and half the links are "not found" so of little help.
Others say that maths.library is "part and parcel" of the standard distribution.

Ya what?

If it is .... "part and parcel", why am I getting the error?

Looking at other options, but the "formulas" are confusing to me as they are not really explained.

Sorry, but that's just how it is for me.

Just to also clarify: I am using a Raspberry Pi.

Thanks in advance.

Just to clarify: this is not the Raspberry Pi forum.

(deleted)

I installed this library: GitHub - probonopd/TimeLord: Arduino library with many time and date related functions... Daylight Savings, Moon Phase, Sidereal time, with the SunRise library rolled in. and File->Examples->TimeLord->SunriseSunset compiled without error for me.

AWOL:
Just to clarify: this is not the Raspberry Pi forum.

897 Posts?

AWOL,

Yes, but I have been told that the RPI IDE is not as "up to date" as the Windows one.

So if it is "included" in the windows one and NOT in the RPI, then there would be some confusion to what is going on.

Reading other replies now.

johnwasser:
I installed this library: GitHub - probonopd/TimeLord: Arduino library with many time and date related functions... Daylight Savings, Moon Phase, Sidereal time, with the SunRise library rolled in. and File->Examples->TimeLord->SunriseSunset compiled without error for me.

Thanks John.

Looking at the link now.

If it was for an Arduino (or for MSVC compiler on a PC) it would be math.h not Maths.h

Pete

(Another post has come in and I have read it.)

If it was for an Arduino it would be math.h not Maths.h

I shall try it shortly, but I now feel I have to explain EVERYTHING as there is confusion awry here.

I am programming an ARDUINO.
To PROGRAM it, I am using a RPI. NOT windows.
Time and time I have been told USE THE WINDOWS ONE - IT IS BETTER.
I can't on a RPI. And I am not going to run windows on a RPI. I am using the RPI IDE.

I went off and tried to find links on how to calculate sunrise and set times. All in weird languages I didn't understand.

Looking for ARDUINO libraries I found sunrise - link posted in first post.
It didn't work. It gives the same error as shown below.

Now granted Pete just said there is a difference with RPI and ARDUINO version names. Arduino being maths.h and RPI being Maths.h.

Given I am getting/downloading the ARDUINO version the case of the library SHOULD not be an issue.
I'll check now anyway, but I think it is a bit childish being flamed for not knowing that when it should be for the arduino.

I am stating I am using the RPI so any limits the IDE has over the "better" one can be allowed for, as I have also been flamed for not stating which IDE I am using before as well.

It is a lose lose situation for me no matter which way I go.

I am still learning this stuff and am asking to learn.
I don't get it that if you all know the answers why you are so afraid to answer the questions I ask - how ever dumb they are.

So what is below is sort of retrospective.... But I don't feel like posting more "as we go" posts each time I get something done/resolved or another issue comes up.

Alas back to square 1.

In file included from SunriseSunset.ino:1:0:
/home/pi/sketchbook/libraries/TimeLord/TimeLord.h:4:19: fatal error: Math.h: No such file or directory
#include <Math.h>
^
compilation terminated.

So it remains a mystery to me that if maths.h is supposed to be included, what is going on.

The link where this came from

You already have math.h.
math.h is part of the core that gcc brings to the party. Arduino-specific libraries do need to be downloaded.

I'm at a loss.

Pete,

Thanks VERY MUCH!

You are right.

The library was Maths.h and not maths.h.

Changed and complied ok.

Update to the sketch and what I have found.

The libraries are badly written as they include invalid names and seem to pull values form no where without explaining what is gong on.
Also libraries shouldn't have dates used in the calculations in them - should they?

I found an old post about automatic chicken coop doors and found that helpful.

From that I have written a sketch which seems to work.

Could someone just give it a quick look over and tell me if I have missed any elephants?

My_Sunrise_calculator.ino (1.49 KB)

902 posts. Doesn't use code tags.

aarg:
902 posts. Doesn't use code tags.

And sometimes when I post with code tags I am told to attach the code.

It is hard (if not impossible) to obey the rules when they keep changing.

When the code is short enough to post directly to the forum, do so and use code tags. If the code is longer than the 9000 character limit for forum posts then attach it.

lost_and_confused:
I am programming an ARDUINO.
To PROGRAM it, I am using a RPI. NOT windows.
Time and time I have been told USE THE WINDOWS ONE - IT IS BETTER.
I can't on a RPI. And I am not going to run windows on a RPI. I am using the RPI IDE.

Seems to me, the first thing to try would be move over to a Windows machine and try to compile your Arduino code using Windows IDE & Libraries. At least then you'd have a better idea where the problem lies. You might even get your code compiled and working so you can move on with your project and save the platform / tools problem for another day.