Main Site Documentation

Extension - Calculate Sunset and Sunrise Time


#1

[title]Calculate Sunset and Sunrise Time[/title]
http://code.tinyclr.com/project/242/calculate-sunset-and-sunrise-time/
[line]
The SunTime class calculates the sunrise and sunset time at a given location / global position. This class implements an algorithm found in Almanac for Computers (1990) published by Nautical Almanac Office.

In home control applications, the time of sunrise and sunset are handy for taking certain actions such as closing blinds.

And so began the search for an accurate calculation of these times. The search ended with a piece of pseudo code from the Almanac for Computers that also proved to work very accurately.


#2

very handy indeed…


#3

In testing I get the error: The type or namespace name ‘daylight time’ could not be found (are you missing a directive or an assembly reference Using?)

What am I doing wrong?


#4

DaylightTime class is in System.Globalization.


#5

The program works well for me now. It took me some time to figure out why it does not run using the Microsoft Emulator.
The function MathEx (GHIElectronics.NETMF.System) requires that it runs on a FEZ.