Stage 1 · Lesson 2 of 6
Fixed-width integer types
The size of int in C depends on the compiler and chip: 16 bits on the classic Arduino Uno, 32 bits on an or . Hardware does not care about your compiler, so embedded code uses the types in , such as uint8_t (an unsigned 8-bit value from 0 to 255), int16_t and uint32_t.
Use unsigned types for , bit patterns and counters, and signed types for values that can go negative, like temperature. Learn what overflow means: a uint8_t at 255 plus one becomes 0. Learn integer promotion too, where small types are widened to int before arithmetic, which surprises people in comparisons and shifts.
Common trapmixing signed and unsigned values in one comparison, so -1 is treated as a huge positive number and a check that looks right quietly fails.
A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock
Resources for this stage
Start with· follow one of these
- VideoFreeModern Embedded Systems Programming (video course)
Quantum Leaps (Miro Samek) · Intermediate
Free lessons that step down to the machine level: watch the first segment on C, bits, pointers and memory
- CourseFreeCS50: Introduction to Computer Science
Harvard University · Beginner
The weeks on C and memory give you pointers, arrays and malloc explained clearly, free