-
Introducing stopwatch mode
08/13/2025 at 21:56 • 0 commentsSo I've heard about the One Hertz Challenge, and realized: I have a project! It's my clock!
However, after carefully considering everything, I've realized that there is nothing happening at the rate of one hertz here, despite it being... erm... a clock:
- The status bar updates every four seconds
- The RTC chip is queried every 500ms
- Brightness is updated every 50ms
- And so on...
The obvious choice here is, of course, to display seconds somewhere. But the LED matrix is too small to fit them together with hours and minutes! Panic!
But then I realized there was something I wanted to implement for a long time: stopwatch mode! Stopwatches usually don't count very far, so there is no need to display hours, and fitting minutes and seconds together is not an issue. And the status bar can display fractions of seconds.
So, now SuperClock can also a be stopwatch! Implementing it posed a tiny challenge: unlike every other timekeeping task, this one required sub-second precision, that was not available from the RTC chip I'm using (DS3231). So, I've had to rely on ATmega32 hardware timer interrupt instead. This makes it somewhat less precise than the usual timekeeping in the long run, but since the stopwatch overflows every 100 minutes, it's not a big deal
Silica Gel