This program uses the "PSA" solar positioning algorithm calculating the sun position, based on longitude, latitude, and time zone. Then Mbed chip controls the two digital servos to rotate the solar panel to the correct azimuth and zenith angle.
Dependencies: 4DGL-uLCD-SE AX12 NetServices mbed spxml
Fork of AX12-HelloWorld by
main.cpp@0:f6f8cf11779f, 2010-06-03 (annotated)
- Committer:
- chris
- Date:
- Thu Jun 03 14:25:20 2010 +0000
- Revision:
- 0:f6f8cf11779f
- Child:
- 1:b12b06e2fc2d
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chris | 0:f6f8cf11779f | 1 | #include "mbed.h" |
chris | 0:f6f8cf11779f | 2 | #include "AX12.h" |
chris | 0:f6f8cf11779f | 3 | |
chris | 0:f6f8cf11779f | 4 | int main() { |
chris | 0:f6f8cf11779f | 5 | |
chris | 0:f6f8cf11779f | 6 | AX12 myax12 (p9, p10, 1); |
chris | 0:f6f8cf11779f | 7 | |
chris | 0:f6f8cf11779f | 8 | while (1) { |
chris | 0:f6f8cf11779f | 9 | myax12.SetGoal(60); // go to 60 degrees |
chris | 0:f6f8cf11779f | 10 | wait (2.0); |
chris | 0:f6f8cf11779f | 11 | myax12.SetGoal(240); // go to 240 degrees |
chris | 0:f6f8cf11779f | 12 | wait (2.0); |
chris | 0:f6f8cf11779f | 13 | } |
chris | 0:f6f8cf11779f | 14 | } |