🛠 Dynamic remapping of Modulino inputs
Objectifs
This advanced tutorial aims to master the software flexibility of the Arduino UNO Q SBC Controller bundle. Unlike traditional hard-wired physical buttons, the Modulino ecosystem allows defining actions for each node (joystick, rotary button, pixels) via software. The goal is to create interchangeable control profiles for distinct applications, such as switching from a Home Assistant navigation mode to a retro gaming mode, without touching the hardware.
Matériel nécessaire
- Arduino UNO Q SBC Controller bundle (UNO Q 4GB board + Modulino nodes: buttons, joystick, rotary button, pixels).
- Computer with Arduino App Lab installed.
- 24-pin USB-C cable for initial configuration.
- 45W USB-C power supply.
- 8-in-1 USB-C Hub (optional for HDMI debugging).
Étapes
- Open Arduino App Lab and connect your UNO Q board. Ensure the firmware is up to date to support dynamic remapping.
- In the "Input Configuration" tab, identify the I2C addresses or unique IDs of each connected Modulino node. The system automatically detects the topology.
- Create a new "Control Profile". Name it "Game Mode". For each node (joystick, buttons), map physical events to desired HID (Human Interface Device) key codes or MIDI commands. For example, map the rotary button to system volume instead of zoom.
- Configure an alternative "Navigation Mode". Here, the joystick will control the Linux mouse cursor, and the rotary button will adjust screen brightness via host system APIs.
- Save profiles to the UNO Q board's internal storage. Use the "Export" function to back up the configuration to a
.jsonor.yamlfile on your computer. - To test switching, use the UNO Q's Linux system API to create a keyboard shortcut or shell script that sends a profile change command to the Modulino service.
Vérification
Launch a target application (e.g., Home Assistant in a browser or an emulator). Activate the "Navigation" profile via the defined shortcut. Verify that the joystick moves the cursor. Switch to the "Game" profile. Verify that the joystick is now recognized as a game controller and that the rotary button adjusts volume. The Modulino pixels should change color to visually indicate the active profile.
Pour aller plus loin
Explore integration with Python scripts on the UNO Q's Linux to create complex macros. You can link a Modulino button press to the execution of a specific shell command, enabling advanced home automation directly from the physical interface.