From 9ffcafd66b1d2c0ace733346c2c2e3c49062fe5e Mon Sep 17 00:00:00 2001 From: Luis Rodil-Fernandez Date: Mon, 1 Aug 2022 13:07:37 +0200 Subject: [PATCH] added variable to store zenith --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 7da7cf3..b038daf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -29,6 +29,7 @@ typedef struct { float latitude; float longitude; float declination; + float zenith; float elevation; float azimuth; } tSolar; @@ -183,7 +184,8 @@ void loop() { sunpos(t, loc, &sunloc); sun.azimuth = sunloc.dAzimuth; - sun.elevation = 90 - sunloc.dZenithAngle; + sun.zenith = sunloc.dZenithAngle; + sun.elevation = 90 - sun.zenith; // method 2 - using SolarPosition library // sun.elevation = location.getSolarPosition(sun.epoch).elevation;