Arduino Programs Guide 1.0.3 is a progressive, safety-first Arduino Uno course covering serial commands, LED patterns, PWM motor control, state machines, and emergency-stop behaviour. Each lesson includes a compile-checked sketch, wiring contract, test procedure, and extension ideas.
Caution
Never connect a DC motor directly to an Arduino pin. Motor lessons require a suitable transistor or H-bridge driver, flyback protection, an external motor supply, and a shared ground. Read Hardware safety before Exercises C–F.
- Map serial commands to digital outputs and reusable functions.
- Build non-blocking LED patterns with arrays, bit masks, and
millis(). - Drive motors safely with PWM, drivers, and fail-safe stops.
- Integrate analog sensing, emergency override, and telemetry in Exercise F.
| Lesson | Project | Main concepts | Hardware |
|---|---|---|---|
| A | Arrow controller | serial input, functions, digital output | 4 LEDs |
| B | Pattern selector | arrays, bit masks, non-blocking timing | 4 LEDs |
| C | Smart fan | PWM, command mapping, safe motor stop | 3 LEDs, driver, motor |
| D | Wheel simulation | H-bridge direction, state machines | 4 LEDs, dual driver, 2 motors |
| E | Synchronized scanner | numeric parsing, map(), animation |
4 LEDs, driver, motor |
| F | Integrated vehicle | analog input, emergency override, telemetry | full circuit |
There is also a Bluetooth LED warm-up for testing a serial module before starting the main exercises.
- Read Getting started and Hardware safety.
- Build Exercise A with the board disconnected from power.
- Upload the sketch and test it in Serial Monitor before adding Bluetooth.
- Complete the lesson's verification checklist.
- After Exercise B, optionally try the companion ArduinoPatterns library.
All sketches use 9600 baud and accept the same characters from USB Serial or a
TTL serial Bluetooth module. On an Uno, the hardware serial pins are shared with
USB; disconnect the module from pins 0/1 while uploading.
arduino-cli compile --fqbn arduino:avr:uno exercises/exercise-a-arrow-controller| Item | Guidance |
|---|---|
| Prerequisites | Arduino Uno or compatible board, breadboard, LEDs/resistors, and for C–F a motor driver, flyback protection, and separate motor supply |
| Suggested pacing | one lesson per session for A–B; one to two sessions for each motor lesson |
| Assessment | require completed wiring checklists, Serial Monitor verification, and a short reflection on safety or non-blocking behaviour |
| Safety gate | do not begin Exercises C–F until students can explain why motors need drivers and shared ground |
Exercise B teaches non-blocking patterns by hand. After students understand the timing model, they can optionally refactor LED banks and timed sequences with ArduinoPatterns. The course itself remains complete without the library.
- Introductory Arduino Uno coursework and maker-space labs.
- Safety-first PWM and H-bridge motor lessons.
- Compile-checked embedded systems laboratories.
- Independent practice with serial, state machines, and digital outputs.
The examples target the Arduino Uno and the Arduino AVR Boards core. CI compiles every sketch with the official Arduino toolchain; that is not hardware validation. Other boards may use different PWM pins, voltage levels, serial ports, or ADC ranges. Porting notes are welcome only when verified on hardware.
- Documentation index
- Getting started
- Hardware safety
- Serial control
- Troubleshooting
- Lessons A–F
- Bluetooth warm-up
- Changelog
@dev.mako (devkyato). (2026). Arduino Programs Guide: safety-first compile-checked Arduino Uno course (Version 1.0.3). Zenodo. https://doi.org/10.5281/zenodo.21853286
See CITATION.cff for machine-readable metadata.
| Project | Role |
|---|---|
| ArduinoPatterns | Optional non-blocking LED and digital-output library |
| Relay | Timing-risk source review for control programs |
| OpenNet | Typed ONP/1 messaging for ESP32, Raspberry Pi, and backends |
| Datary | Local-first laboratory for reproducible program evidence |
Student contributions are encouraged. Good changes include clearer diagrams, hardware results, non-blocking improvements, and new tests that preserve each lesson's learning objective. Read CONTRIBUTING.md before opening a pull request.