Skip to content

Commit 97593c8

Browse files
Updated the simple example.
1 parent f7792d0 commit 97593c8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

examples/simple/simple.ino

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
#include <moonPhase.h>
22

3-
moonPhase moonPhase; /* include a MoonPhase instance */
3+
moonPhase moonPhase; // include a MoonPhase instance
44

55
void setup() {
66
Serial.begin(115200);
77
Serial.println();
88
Serial.println( "moonPhase simple example." );
99

10-
moonData_t moon; /* variable to receive the data */
10+
moonData_t moon; // variable to receive the data
1111

12-
moon = moonPhase.getInfo(); //get the current moon phase (1/1/1970 at about 00:00:00 UTC )
12+
moon = moonPhase.getPhase(); // gets the current moon phase (1/1/1970 at 00:00:00 UTC )
13+
// Because moonPhase uses the system time, which is not set in this example
1314

1415
Serial.print( "Moon phase angle: " );
15-
Serial.print( moon.angle ); /* angle is a integer between 0-360 */
16+
Serial.print( moon.angle ); // angle is a integer between 0-360
1617
Serial.println( " degrees." );
1718
Serial.print( "Moon surface lit: " );
18-
Serial.printf( "%.0f%%", moon.percentLit * 100 ); /* percentLit is a real between 0-1 */
19+
Serial.print( moon.percentLit * 100 ); // percentLit is a real between 0-1
1920
}
2021

2122
void loop() {

0 commit comments

Comments
 (0)