forked from dmkishi/Dusk2Dawn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dusk2Dawn.h
41 lines (37 loc) · 1.17 KB
/
Dusk2Dawn.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* Dusk2Dawn.h
* Get time of sunrise and sunset.
* Created by DM Kishi <[email protected]> on 2017-02-01.
* <https://github.com/dmkishi/Dusk2Dawn>
*/
#ifndef Dusk2Dawn_h
#define Dusk2Dawn_h
#include "Arduino.h"
class Dusk2Dawn {
public:
Dusk2Dawn(float, float, float);
int sunrise(int, int, int, bool);
int sunset(int, int, int, bool);
static bool min2str(char*, int);
private:
float _latitude, _longitude;
int _timezone;
int sunriseSet(bool, int, int, int, bool);
float sunriseSetUTC(bool, float, float, float);
float equationOfTime(float);
float meanObliquityOfEcliptic(float);
float eccentricityEarthOrbit(float);
float sunDeclination(float);
float sunApparentLong(float);
float sunTrueLong(float);
float sunEqOfCenter(float);
float hourAngleSunrise(float, float);
float obliquityCorrection(float);
float geomMeanLongSun(float);
float geomMeanAnomalySun(float);
float jDay(int, int, int);
float fractionOfCentury(float);
float radToDeg(float);
float degToRad(float);
static bool zeroPadTime(char*, byte);
};
#endif