This Project holds the source code for the project Morgeb, the friendly clock for eachdays morning
.
The project is powered by an AtMega382 in combination with a DS3231 RTC.
- FrontPanel(private): FrontPanel wrapper lib
- RTClib: Handle DS3231 RTC
We have tried to keep the code as simple as possible. So there is no wifi or similar available, it is a analog clock.
!!! POC: Version !!!
Currently, the code is still in POC, further we will add some buttons and brightness control.
During the setup phase, we initiate the RTC and FrontPanel. Most of the time, the mc is sleeping, it get's woke up by the RTC every five minutes. After wakeup, it fetches the current time and does the Frontpanel update.
void loop()
{
DateTime now = rtc.now();
// compute next wakeup, which is a multiple of 5 and has 0 seconds
// hence, we substract the current seconds and compute the next smooth minute value
DateTime nextWakeup = now -
TimeSpan(0, 0, now.minute(), now.second()) +
TimeSpan(0, 0, ((now.minute() + RTC_SLEEP_TIME) / RTC_SLEEP_TIME) * RTC_SLEEP_TIME, 0);
rtc.setAlarm1(nextWakeup, DS3231_A1_Minute);
frontpanel.update(now.hour(), now.minute(), now.second());
// sleep until we need to update the clock again
goSleep();
}
Please find here all the open tasks, which are not needed by nice to have
- create an PCB for the driver
- properply find a nicer light diffusion way than milk folio