/Arduino-Sun

An Arduino library for calculating sunrise and sunset times.

Primary LanguageC++GNU General Public License v3.0GPL-3.0

Arduino-Sun

changes for esp8266

Arduino library for calculating sunrise and sunset times.

Calculations are done using the sunrise equation.

The library takes current time in Unix Timestamp format and returns sunrise and sunset times for the ongoing day in the same format.

Use of Arduino Time library is recommended for timekeeping and converting between time formats.

Usage

// Initialize Sun object with local coordinates
Sun sun(46.24, 15.27);
// Current time (Unix Timestamp)
unsigned long tm = 1486908295
// Calculate time of sunrise for the ongoing day
unsigned long rise = sun.getRise(tm);
// Print results
Serial.print("Sun rises at: "); Serial.println(rise);