const and flash
The Uno has 32 KB of flash and only 2 KB of SRAM, and every string literal is copied into SRAM at boot. A sine table in PROGMEM costs nothing, and F() on one help text gives back 308 bytes.
Open it in the simulatorThe rules that keep C alive on a chip with 2 KB of RAM, each one broken on the Uno first: 16-bit int overflow, a missing volatile on an interrupt flag, F() and PROGMEM saving SRAM, out-of-bounds writes and signed shifts, String running the heap dry, MISRA-style rules, and a satellite sketch to audit.
0 of 7 done
7 lessons in 3 chapters, about 6 hours on a simulated Arduino Uno R3. Free, in your browser, every step checked by the simulator.
The Uno has 32 KB of flash and only 2 KB of SRAM, and every string literal is copied into SRAM at boot. A sine table in PROGMEM costs nothing, and F() on one help text gives back 308 bytes.
Open it in the simulatorA heater’s command parser written to MISRA-style rules: fixed-width types, named limits, every input range-checked, a static_assert, no heap, and a switch whose impossible case finally says something.
Open it in the simulatorEach lesson opens when the one before it is done, and each chapter ends in a project.
What an int really is, what volatile does, and where const data lives.
An int is 16 bits on an Uno: five minutes in milliseconds comes out negative, a uint8_t counter wraps to 4, and a millis() interval stays right across the 49-day wrap. Fixed-width types say what you mean.
0 of 6 steps
The button’s interrupt runs, toggles the lamp and sets a flag, and loop() never sees it, because the optimizer kept the flag in a register. One keyword fixes it, and noInterrupts() makes a 4-byte read safe.
0 of 5 steps
The Uno has 32 KB of flash and only 2 KB of SRAM, and every string literal is copied into SRAM at boot. A sine table in PROGMEM costs nothing, and F() on one help text gives back 308 bytes.
0 of 5 steps
Undefined behavior, the heap, and rules a tool can check.
A loop that runs one step too far writes the knob reading over the alarm limit next door, so the alarm can never fire; a shift into the sign bit goes negative. Both compile cleanly; both are undefined behavior.
0 of 5 steps
A telemetry log built with String eats the heap line by line until concat() fails at line 120; the same log in a fixed buffer, sized at compile time, runs for ever with the same largest free block.
0 of 5 steps
A heater’s command parser written to MISRA-style rules: fixed-width types, named limits, every input range-checked, a static_assert, no heap, and a switch whose impossible case finally says something.
0 of 6 steps
Audit a satellite telemetry sketch with three hidden bugs.
A CubeSat telemetry sketch that compiles without a warning and has three bugs: a mission clock that overflows, a ground station call that loop() never sees, and a checksum written one byte past its buffer into the battery reading. Find each one, then fix it.
0 of 7 steps
All 7 lessons, in order, each with what it covers. Any of them opens in the editor right away.
Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.
Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.
See every kitYes. All 7 lessons of Embedded C that survives are free and run in your browser, with nothing to install and no parts to buy before you start.
No. Every lesson runs on a simulated Arduino Uno R3 with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.
About 6 hours: 7 lessons in 3 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.
Each chapter ends in a project that puts it together: const and flash and Coding standards.
With "Fixed-width types", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.