Browse Source

added variable to store zenith

master
Luis Rodil-Fernandez 2 years ago
parent
commit
9ffcafd66b
  1. 4
      src/main.cpp

4
src/main.cpp

@ -29,6 +29,7 @@ typedef struct {
float latitude; float latitude;
float longitude; float longitude;
float declination; float declination;
float zenith;
float elevation; float elevation;
float azimuth; float azimuth;
} tSolar; } tSolar;
@ -183,7 +184,8 @@ void loop() {
sunpos(t, loc, &sunloc); sunpos(t, loc, &sunloc);
sun.azimuth = sunloc.dAzimuth; sun.azimuth = sunloc.dAzimuth;
sun.elevation = 90 - sunloc.dZenithAngle;
sun.zenith = sunloc.dZenithAngle;
sun.elevation = 90 - sun.zenith;
// method 2 - using SolarPosition library // method 2 - using SolarPosition library
// sun.elevation = location.getSolarPosition(sun.epoch).elevation; // sun.elevation = location.getSolarPosition(sun.epoch).elevation;

Loading…
Cancel
Save