1.1 C from zero
What a microcontroller is and how code gets onto it, then the core of C: variables, decisions, loops, functions, binary and hex, arrays, a first look at…
Lessons
- Microcontrollers and your first program · What a microcontroller is, how code gets onto it, and the parts of a C program.
- Variables and operators · Storing values, doing arithmetic, comparing, and the two surprises of integer maths.
- Decisions and loops · Choosing with if and switch, repeating with while and for, and the loop that never ends.
- Functions · Splitting a program into named pieces, passing values in and getting results back.
- Binary and hexadecimal · Bits, bytes, hex digits and negative numbers, the way hardware actually stores values.
- Arrays and text · Many values under one name, looping over them safely, and strings.
- A first look at pointers · Addresses, and how a function reaches a variable that belongs to its caller.
- Structs, enums and typedef · Grouping values into structs, the dot and the arrow, naming choices with enum, and shorter names with typedef.
Project: Digital kitchen scale
Your first product, one small piece per lesson: the display, unit conversion, what to show when, the tare button, a steady reading, the lightest and heaviest portion, and a recipe mode. Each piece is checked right in the page.