Examples

last modified: October 23, 2025

Guide to Modular Firmware

Posted on 2019-07-14— C++, Improve your Code, Learn

I wrote a concise guide for embedded developers to refactor Arduino/C++ firmware into clean, modular components. I walk you through creating Display, Buttons, and Animation modules, testing and committing small changes, and improving maintainability. If you'd like practical steps and examples, please read the full article.

Read this post

Class or Module for Singletons?

Posted on 2019-07-09— C++, Improve your Code, Learn

I compare implementing a singleton as a class or as a module/namespace for Arduino firmware using simple LED driver examples and compiler measurements. I cover size, initialization and runtime trade-offs and explain when each approach makes sense. Read the full post for code, disassembly and practical recommendations.

Read this post

Event-based Firmware (Part 1/2)

Posted on 2019-07-05— C++, Improve your Code, Learn

I walk through a practical, minimal event-based approach to firmware using Arduino examples. Step by step I refactor blink sketches into modular events, introduce a millisecond timer, prevent skipped events, and encapsulate logic into classes and modules. Read on to follow the examples and apply them to your projects.

Read this post