PE1-4.2 Embedded C & I/O Programming
You can write embedded C using its data types, operators, control statements, arrays and functions, and drive pins with pinMode, digitalRead/Write, analogRead/Write and delay functions.
Embedded C is C with the standard library mostly absent and the hardware exposed, so the discipline is knowing what your code costs in bytes and cycles. The analogWrite name is the unit's built-in trap: it produces PWM, not a true analog voltage, and expecting a real DAC output is a classic first mistake. Learn to avoid delay() early — it blocks everything — because that habit is what separates a sketch that blinks from one that does two things at once.
Work through these
Data types: variables and constants
The language basics as they apply here, where memory is measured in kilobytes. Choosing a smaller type is a real decision on this hardware rather than a style preference.
Operators and control statements
The operators and flow control, moving quickly because they are shared with every language you know. Bit operations deserve more attention here than elsewhere.
Arrays and functions
Grouping data and grouping code. Functions matter more than usual on a small device because the alternative is one enormous loop.
Pins configured as input and as output
The direction a pin faces, which has to be set before it can be used. Forgetting it is the most common first bug.
The pinMode function
The call that sets that direction. Small, and the input-with-pull-up option is the one people miss and then wire an external resistor for.
digitalWrite and digitalRead
Reading and writing a single digital pin, which is the whole of digital input and output. Everything in the interfacing topic is built from these two calls.
analogRead and analogWrite (PWM)
The analog equivalents, one of which is not truly analog: the output is a switching signal whose average is what you want. Knowing that changes what you can drive with it.
Time delay functions and why blocking delays cause problems
Pausing, and the reason the obvious call is a problem: nothing else can happen while it waits. Learning the non-blocking pattern early saves rewriting every project later.
Sign in to keep your progress.
Free resources
We haven't checked most of these for screen reader use yet.
Links last checked 30 Aug 2026.
Stuck here?
Ask a mentor. A real person answers, and they can see exactly which topic you're on. Usually within a couple of working days.
Checking your session…
Topics shown in module order.