Source: https://mokxi.com/teachers/plans/c-from-zero
Updated: 2026-11-11

Lesson plan

# C from zero lesson plan

The language under every microcontroller, from a first hello over serial: types and sizes, overflow, if and switch, loops, functions and pointers, arrays and strings. Ends with a serial quiz you build and make your own.

4 chapters, 8 lessons, about 7 hours, on the Arduino Uno R3. Every lesson runs in the browser, with nothing to install.

Start a class from this course

The unit

## Objectives and materials

### By the end, students can

- Print over serial, and the boxes numbers live in.
- Operators and what overflow does, then if and switch.
- Loops, then functions, pointers and scope.
- Arrays and C strings, then a quiz built from everything.

### Materials for the whole unit

- Arduino Uno R3
- Full-size breadboard
- LED x 3
- Pushbutton
- Resistor x 3

Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.

Chapter 1. About 1 h 35 min

## Talk and count

Print over serial, and the boxes numbers live in.

Lesson | Time | What students do

Hello over serial The first C program on an Uno: setup and loop, print against println, a char that turns out to be a number, and a line built with snprintf every second. | 50 min

- Run it: hello, world
- print and println
- A char is a number
- A line with holes in it
- Say hello your way
- Make it tick faster
- Quick check: predict, then run

Types and sizes Every variable is a box with a fixed number of bytes. sizeof on the Uno, the fixed-width types from stdint.h, what each one holds, and a char that is really a number. | 45 min

- Run it: an int is 2 bytes
- long, and why pointers matter
- Say the size: stdint.h
- Letters are codes
- Pick a bigger box
- Quick check: predict, then run

### Materials

- Arduino Uno R3
- Full-size breadboard
- LED x 3
- Pushbutton
- Resistor x 3

### Check for understanding

Each student finishes "Types and sizes" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Quick check: predict, then run".

Chapter 2. About 1 h 50 min

## Do the math, pick a path

Operators and what overflow does, then if and switch.

Lesson | Time | What students do

Operators and overflow Integer division and the remainder, a uint8_t that wraps like an odometer, an int that overflows and why that is undefined, the fix with a wider type, and bitwise operators on three lamps. | 50 min

- Run it: 7 / 2 is 3
- Division and remainder, working together
- A uint8_t wraps around
- An int overflows
- Fix it with a wider type
- Bitwise: one bit at a time
- Quick check: predict, then run

if and switch The program picks one way to go: serial commands chosen with a switch, a fall-through bug to find and fix, an else-if ladder for temperatures, and a button read with if. | 60 min

- Run it: type r
- default catches the rest
- The bug: yellow lights green
- Add the break
- Fall-through on purpose
- An else-if ladder
- if on a pin
- Quick check: predict, then run

### Materials

- Arduino Uno R3
- Full-size breadboard
- LED x 3
- Pushbutton
- Resistor x 3

### Check for understanding

Each student finishes "if and switch" on their own, without opening the hints. The simulator checks 8 of its 8 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Quick check: predict, then run".

Chapter 3. About 1 h 40 min

## Again, and by name

Loops, then functions, pointers and scope.

Lesson | Time | What students do

Loops Do it again: for when you know how many times, while when you wait for something, do-while that always runs once, continue and break, a loop inside a loop, and a while that waits for a button. | 50 min

- Run it: count to ten
- while: until the test fails
- continue and break
- A loop inside a loop
- Wait for a button
- Change the table
- Quick check: predict, then run

Functions Name a piece of work once: prototypes, parameters and return values, why a copy cannot change the caller and a pointer can, a local that hides a global, and a static counter that remembers. | 50 min

- Run it: square(12)
- Prototypes: the promise first
- A copy goes nowhere
- A pointer reaches the original
- static remembers
- Why power returns a long
- Quick check: predict, then run

### Materials

- Arduino Uno R3
- Full-size breadboard
- LED x 3
- Pushbutton
- Resistor x 3

### Check for understanding

Each student finishes "Functions" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Quick check: predict, then run".

Chapter 4. About 1 h 50 min

## Data and a project

Arrays and C strings, then a quiz built from everything.

Lesson | Time | What students do

Arrays and strings Many values in a row: sum and max over an array, its length from sizeof, and text as a char array ending in a zero byte, with strlen and strcmp written by hand and a buffer that never overflows. | 50 min

- Run it: five readings
- C does not know how long it is
- A string is chars and a zero
- Type a word
- Compare strings, by hand
- Add a reading
- Quick check: predict, then run

Project: a serial quiz Everything in the course in one program: questions in an array of structs, answers read from Serial, a switch to check them, a score, lamps for right and wrong, and a button to start again. Then make it yours. | 60 min

- Run it: the first question
- Answer right
- Answer wrong
- Finish and score
- Start again with the button
- Add a question
- Raise the bar
- Make it yours

### Materials

- Arduino Uno R3
- Full-size breadboard
- LED x 3
- Pushbutton
- Resistor x 3

### Check for understanding

Each student finishes "Project: a serial quiz" on their own, without opening the hints. The simulator checks 8 of its 8 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Make it yours".

Your class

## Teach this unit as a class

Start a class from this course and its 8 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.

The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.

Start a class from this course See the demo class

More units

## Other lesson plans

Electronics basics 20 lessons, about 10 h. Embedded on the Arduino Uno 16 lessons, about 12 h. Embedded on the ESP32-C3 13 lessons, about 11 h. Embedded on the Raspberry Pi Pico 7 lessons, about 6 h. Build your own fight stick 5 lessons, about 4 h. Embedded on the STM32F411 6 lessons, about 6 h. C++ on a board 13 lessons, about 10 h. Digital logic and memory 4 lessons, about 4 h. Interactive devices on the Uno 9 lessons, about 8 h. From gates to a computer 23 lessons, about 16 h. Build a claw machine 8 lessons, about 6 h. Every unit All the courses as ready-made units, on the teachers page.
