Topic
C++ programming
Short insights that take you from your first main() to classes, with what changes on a microcontroller (MCU) and on a microprocessor (MPU) called out as you go. Each one is a 2–3 minute read with a diagram, code that compiles, and the output it prints.
void poll_sensors();int main() { while (true) { poll_sensors(); }}
Insights
-
From source to binary
How your .cpp file becomes firmware on a chip.
-
Types and operators
Why uint8_t beats int when every byte counts.
-
i++, ++i and compound assignment
The shorthand behind every register bit-flip.
-
if/else and switch
Decisions, and the switch-based state machine.
-
Loops
while, do-while, for, and the super-loop that never ends.
-
Functions
By value or by reference, and when to inline.
-
Arrays and strings
Fixed buffers with no heap in sight.
-
Pointers and references
Addresses, and the pointer that talks to hardware.
-
Classes and objects
An Led class that sets up its own pin.
-
public, private, protected
Hiding registers behind a safe interface.
-
Inheritance
One Sensor interface, many sensors, and what virtual costs.