Loading...
Searching...
No Matches
moon.c File Reference

Pure moon-phase math, host-testable off-device. More...

#include "clock/moon.h"

Functions

int32_t moon_age_sec (time_t utc)
 How far into the current moon cycle we are, in seconds.
int moon_glyph_index (time_t utc, int count)
 Picks one of count evenly spaced phase icons. It wraps back round at the end.
int moon_illumination_pct (time_t utc)
 How lit up the moon looks, from 0 to 100. This is a rough straight-line guess, so it reads 0 at new moon and 100 at full.
int moon_days_to_phase (time_t utc, bool to_full)
 How many days until the next full or new moon, rounded to the nearest whole day.
const char * moon_phase_name (time_t utc)
 Short name for the current phase (one of the eight main phases).

Detailed Description

Pure moon-phase math, host-testable off-device.