- Home
- Skills
- Wedsamuel1230
- Arduino Skills
- Arduino Code Generator
arduino-code-generator_skill
- Python
6
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill wedsamuel1230/arduino-skills --skill arduino-code-generator- SKILL.md5.8 KB
Overview
This skill generates production-ready Arduino and embedded C++ code snippets and patterns for UNO, ESP32, and RP2040 boards. It focuses on practical, memory-conscious implementations for sensors, actuators, communication protocols, timing patterns, and data persistence. Use it to get board-optimized sketches, wiring hints, and non-blocking patterns you can drop into projects.
How this skill works
Tell the skill the board and the pattern or hardware you need (for example DHT22 reading, I2C scanning, or non-blocking scheduler). The generator produces complete sketches or focused snippets with pin definitions, conditional multi-board config, timing logic using millis(), and board-specific optimizations. Output includes error handling, memory-aware constructs (buffering, wear leveling, CRC), and brief integration notes for wiring and libraries.
When to use it
- You need tested Arduino code for sensors (DHT22, BME280) or analog inputs with filtering.
- Implement non-blocking timing, schedulers, or state machines without delay().
- Add communication patterns: I2C scanning, SPI setup, UART/CSV logging, or WiFi for ESP32.
- Create robust data persistence: EEPROM with CRC, SD logging, or wear-leveling.
- Prototype multi-button input handling with debouncing and long-press detection.
- Optimize a sketch for board-specific constraints (SRAM limits, timers, CPU features).
Best practices
- Prefer non-blocking millis()-based timers and cooperative schedulers over delay().
- Use conditional compilation for multi-board pin maps and feature flags.
- Validate sensor data and add fallback strategies to handle hardware faults.
- Keep RAM usage predictable: prefer streaming/buffered writes and fixed buffers.
- Add CRC or checksums for persistent storage to detect corruption before use.
Example use cases
- Generate an ESP32 sketch that reads BME280, filters values, and sends CSV over Serial or WiFi.
- Create an UNO-compatible button manager that detects press, release, and long-press events.
- Produce an RP2040 non-blocking scheduler for periodic sensor sampling and SD card logging.
- Generate an I2C scanner and diagnostic routine for troubleshooting connected sensors.
- Create EEPROM-backed configuration with CRC and fallback defaults for robust boot behavior.
FAQ
UNO, ESP32, and RP2040 are primary targets. Common peripherals include DHT22, BME280, I2C, SPI, buttons, EEPROM, SD cards, and WiFi on ESP32.
Will the generated code compile out of the box?
Yes—sketches are produced to compile for the chosen board, but you must install any required vendor or sensor libraries and select the correct board in your IDE.