In this blog post I explain the microcontroller firmware that emulates candlelight in more detail. You can apply the explained techniques in similar situations to get organic effects on CPU and RAM-limited platforms. I will focus in my description on emulating a convincing random effects with minimal resource usage. Demo The following video demonstrates the…
Tag: arduino
Event-Based Firmware Example
If you read the previous articles about event-based firmware, modularisation and templates, you may wonder how to combine all these concepts in your firmware. I created a working firmware example, based on an event loop. In contrast to the minimal example code in my articles, this one contains everything you need to start a project….
C++ Templates for Embedded Code
Templates are a powerful feature of the C++ language but their syntax can be complex. This causes some developers to not use them, while others are concerned that templates might cause bloat to the compiled code. I will explain how templates work and how you may use them in your code. Although the examples I…
Guide to Modular Firmware
This article is for embedded software developers with a solid working knowledge of C or C++, but who struggle with large and complex projects. If you learn to develop embedded code, e.g. using the Arduino IDE, you find plenty of small example programs. It is helpful to get things started quickly, but as soon as…
Class or Module for Singletons?
Should you use a class or a module with a namespace for a singleton interface in your firmware? I found there are many misunderstandings which lead beginners to make a wrong decision in this matter. With this article, I try to visualize these misunderstandings with simple example code for the Arduino platform. Before we start,…
Event-Based Firmware (Part 2/2)
In the first part of this series, we explored the general concept of event-based firmware. To read that article, follow this link. The concepts we discussed were directly tailored to one specific firmware. Now, let’s develop those concepts further to build an event system that can be integrated into many different applications. First, we’ll look…
Event-based Firmware (Part 1/2)
You start with small, simple firmware. But with each added feature, the complexity grows and grows. Soon, you need a good design in order to maintain the firmware and ensure the code remains clean and readable. In this article, I explain the event-based approach for writing firmware. I use the term “event-based” because it is…
A New Modular CMake Based Toolchain for Feather M0 HAL
In the past months, I developed firmware for a few Adafruit Feather M0 based projects. The reason why I use the Adafruit Feather platform, instead of using an MCU directly, is for modularity. By using a board on sockets, it can be replaced at any later time with a more powerful one – or by…