Course
C++ for Embedded
Classes, RAII, templates, and zero-overhead abstraction — the C++ subset that's idiomatic on microcontrollers, and what to leave off the chip.
3h 39m total10 lessonsBeginner friendly
Get started
Enroll to track your progress and unlock the lesson shell.
- Progress tracked per lesson
- Course shows up in your dashboard
- Bookmarks, notes & more (coming soon)
Lesson Content
0/10 done- 11C++ vs C for EmbeddedWhat C++ adds over C on a microcontroller: classes, RAII, templates, references, and the zero-overhead principle that makes those abstractions free.20 min
- 22Classes & EncapsulationBundle data with the code that operates on it, and hide the internals behind a clean interface: the C struct-plus-functions pattern, made safe by the compiler.22 min
- 33Constructors, Destructors & RAIITie setup to object creation and cleanup to scope exit, so you can't forget to release a lock, disable a clock, or re-enable interrupts. The defining C++ idiom for embedded.25 min
- 44References vs PointersReferences are aliases that can't be null and can't be reseated. When to reach for a reference, when you still need a pointer, and why const& is the default way to pass objects.20 min
- 55const Correctness & constexprconst propagates read-only intent through your whole API; constexpr moves computation to compile time so lookup tables and config land in flash with zero runtime cost.22 min
- 66Function & Operator OverloadingOne name, several type-specific implementations the compiler picks for you, and giving your own types natural operators, without the runtime cost of C's void* or tagged dispatch.20 min
- 77Templates: The BasicsWrite a function or class once and have the compiler stamp out a type-specific version for each use: generic code with zero runtime cost, plus the code-bloat tradeoff to watch.25 min
- 88Namespaces & Code OrganizationGroup related names to avoid collisions, replace C's prefix conventions, and structure firmware into headers and translation units that compile fast and read clearly.18 min
- 99What to Avoid on MCUsThe three C++ features that cost more than they're worth on a microcontroller (exceptions, RTTI, and dynamic allocation): why they hurt, and the deterministic patterns to use instead.22 min
- 1010The HAL PatternAbstract a peripheral behind an interface so app logic survives an MCU swap and runs in a PC unit test, using runtime virtuals or zero-overhead compile-time polymorphism.25 min
Stay consistent, achieve mastery!
Complete more lessons to level up your skills.