Skip to content

An Arduino library for calculating sunrise and sunset times.

License

Notifications You must be signed in to change notification settings

nplan/Arduino-Sun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arduino-Sun

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);

About

An Arduino library for calculating sunrise and sunset times.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages