Accessible Embedded Games with STM32, Zephyr, and Lua
Published at October 19, 2025 · Last Modified at October 20, 2025 · 5 min read · Tags: embedded zephyr lua stm32 c++ rtos accessibility bsp iot led-matrix
Accessible Embedded Games with STM32, Zephyr, and Lua
Published at October 19, 2025 · Last Modified at October 20, 2025 · 5 min read · Tags: embedded zephyr lua stm32 c++ rtos accessibility bsp iot led-matrix
Building complex embedded systems does not always mean industrial controllers or medical devices.
Sometimes it means designing human-centered applications.
This post presents my project alyn — an accessible game platform built on STM32, Zephyr RTOS, Lua scripting, and a 32×32 RGB LED matrix.
In addition to the embedded firmware, I also developed a Windows-based emulator of the board.
This emulator allows developers to program and run Lua scripts on a PC, simulating board operation before deployment to the STM32 hardware.
The goal was to create a game system for children with special needs, deployed in a swimming pool environment.
Requirements included:
I selected Zephyr RTOS instead of FreeRTOS because it brings a Linux-like development model:
west
, CMake).This gave me a scalable, maintainable foundation for the system.
Most embedded projects hardcode all logic in C or C++.
Here I wanted non-embedded developers (educators, therapists) to extend games without firmware changes.
led_set(pattern)
score_increment()
get_input("button1")
This meant a game designer could edit a .lua
script and reload behavior — without touching firmware.
To make the games engaging, I integrated a 32×32 RGB LED matrix panel, inspired by this STM32F4 plasma project.
The LED panel gave children instant visual feedback: bright colors, animations, and patterns that made the game more engaging.
It also served as a test case for combining strict real-time tasks (LED refresh) with flexible scripting (Lua) on a resource-constrained MCU.
The diagram below shows the overall system architecture:
STM32 hardware with Zephyr drivers, the Lua scripting engine, and the RGB LED panel working together to provide real-time interaction.
alyn/
├── src/
│ ├── main.cpp # Zephyr application entry
│ ├── game_api.cpp # C++ ↔ Lua bindings
│ └── drivers/ # Custom peripheral drivers
├── scripts/
│ └── demo_game.lua # Game rules (LED sequences, scoring)
├── CMakeLists.txt
└── prj.conf # Zephyr build configuration
Lua Integration
Thread Isolation
k_thread
.LED Panel Driver
Debugging
print()
to Zephyr logging subsystem.This project was an experiment in combining embedded RTOS discipline, Lua scripting flexibility, and RGB LED panel control.
It showed how Zephyr + Lua + STM32 + LED matrix can provide a unique blend of real-time control, visual feedback, and human-centered design.
👉 Source code is available here: GitHub: yairgd/alyn