29. Oktober 2022

Pomodoro Timer: Prototype, Round 2

The “pomodoro technique” is a simple time management method, which requires a robust, simple-to-use timer, which doesn’t distract from the task at hand. After the first prototype with the ATmega32-based RN-Control v1.4 experimental board, I built another prototype: this time with a 4-digit display.

A few weeks ago, I hacked together an ATmega32-based prototype of a pomodoro timer on a board that had been unused for a long time. I made use of the array of LEDs to indicate how much time has passed. This time, however, I started with a 4-digit display. My forays into programming microcontrollers have been few and far, so this will be an adventure.

The thought of programming microcontrollers in C did not sound as attractive, so I started off with TinyGo. TinyGo had a nice and simple first-timer experience with regards to the toolchain. But I could not get the driver for the TM1637 4-digit display to work, not even the example. Maybe I held things the wrong way. So I decided to shelve the idea of using TinyGo for the time being.

Then I decided to dabble in Rust, next. But somewhere halfway through the process of programming my microcontroller (an Arduino Mkr Wifi 1010), I got a bit bored of fiddling around with setting up ever more toolchains just to get some LED blinking (the Hello, World in the embedded universe). Thus, instead, I decided to revert to a more goal-driven approach, and shelve the idea of using Rust for the time being.

After realizing that I could at least use C++ (and probably need almost none of it), I made peace with whatever programming language will get the work done, and decided to focus on the task at hand. The driver for the 4-digit display shipped within the Arduino ecosystem worked, so did some example code from a Timer library that would allow me to implement the countdown, and so did the example code to debounce button presses (which significantly improved user experience, I must say). The code is terrible, it’s untested, but it’s a prototype, and it’s a hobby project: so I get to choose what I want to explore. Finally, the second prototype got a facelift compared to the first prototype: see for yourself.