Open this program in the mbed Compiler, where you can edit it and compile it for your hardware.
Download this program as .zip file.
This code is imported direct from http://rredc.nrel.gov/solar/codesandalgorithms/solpos/
Copyrights are retained in the code for each algorithm used.
The library calculates the apparent solar position and intensity (theoretical maximum solar energy) based on the date, time, and location on Earth.
The calculated data can be used to predict solar radiation, to be used in meteorological, solar energy and irrigation applications.