diff options
author | Eric Dao <eric@erickhangdao.com> | 2022-07-09 22:38:28 -0400 |
---|---|---|
committer | Eric Dao <eric@erickhangdao.com> | 2022-07-09 22:38:28 -0400 |
commit | cb234a53f606de8bd136b596a316e912ddf15185 (patch) | |
tree | c5f4bf00e4e7e038c24f4ff79f3c5f7af9474ca9 /software/include/sun.h | |
parent | 9dd37009b3dc7d4d155f5c1a529ace46e55c8e0d (diff) | |
download | motorized_blinds-master.tar.gz motorized_blinds-master.tar.bz2 motorized_blinds-master.zip |
Diffstat (limited to 'software/include/sun.h')
-rw-r--r-- | software/include/sun.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/software/include/sun.h b/software/include/sun.h new file mode 100644 index 0000000..33f4eb7 --- /dev/null +++ b/software/include/sun.h @@ -0,0 +1,18 @@ +#include <stdio.h> +#include <string.h> +#include <stdbool.h> +#include <math.h> +#include <sys/time.h> +#include <time.h> + +#define LOCAL_OFFSET -4 + +#define LONGITUDE -79.3832 +#define LATITUDE 43.6532 + +#define _USE_MATH_DEFINES + +double deg_to_rad(double angle); +double rad_to_deg(double angle); + +double sun_calculation(struct tm curr_time, double longitude, double latitude); |