Lesson plan

Touch apps on the Cheap Yellow Display lesson plan

Make touch-screen gadgets on the Cheap Yellow Display, an ESP32 with a screen built in: shapes, text and fonts, touch points, buttons on screen, a WiFi clock, and a space mission panel.

4 chapters, 7 lessons, about 5 hours, on the Cheap Yellow Display (ESP32-2432S028R). Every lesson runs in the browser, with nothing to install.

The unit

Objectives and materials

By the end, students can

  • The board, then shapes, colors and animation.
  • Fonts and text, and where a finger lands.
  • Buttons that do things, and a clock that asks the internet.
  • A touch remote: a space mission panel.

Materials for the whole unit

  • Cheap Yellow Display (ESP32-2432S028R)

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 20 min

The screen

The board, then shapes, colors and animation.

LessonTimeWhat students do
The board tourMeet the Cheap Yellow Display: an ESP32 glued to a touch screen. Where the screen, the touch film, the RGB LED and the free pins are wired, and a first hello on the screen.40 min
  1. Run it: a computer with a screen
  2. The screen
  3. The touch film
  4. The RGB LED, lit LOW
  5. Say your name
  6. What else is on it
Drawing shapesA night launch in pixels: coordinates where y grows down, lines, rectangles, circles and triangles, colors as RGB565 numbers, and a satellite animated by erasing and redrawing.40 min
  1. Run it: a night launch
  2. Where is (0, 0)?
  3. Colors are numbers
  4. Animate by erasing
  5. A red-hot flame
  6. Draw your own

Materials

  • Cheap Yellow Display (ESP32-2432S028R)

Check for understanding

Each student finishes "Drawing shapes" 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: "Draw your own".

Chapter 2. About 1 h 20 min

Words and touch

Fonts and text, and where a finger lands.

LessonTimeWhat students do
Text and fontsWords and numbers on the screen: TFT_eSPI’s numbered fonts measured in pixels, the text datum that anchors a string, scaling, and a score that counts up without flicker.40 min
  1. Run it: four fonts
  2. Bigger fonts
  3. The datum
  4. A score with no flicker
  5. Twice the size
  6. Lay out a screen
Touch pointsWhere did the finger land? Read the XPT2046 touch chip, see its raw numbers, map them to pixels, draw a crosshair, and find out what calibration is by getting it wrong.40 min
  1. Run it: touch the screen
  2. Touch near the top left
  3. Lift
  4. Raw numbers and calibration
  5. Get calibration wrong
  6. Resistive or capacitive

Materials

  • Cheap Yellow Display (ESP32-2432S028R)

Check for understanding

Each student finishes "Touch points" 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: "Resistive or capacitive".

Chapter 3. About 1 h 20 min

Real apps

Buttons that do things, and a clock that asks the internet.

LessonTimeWhat students do
Buttons on screenTurn rectangles into buttons: a struct for each one, a hit test, a pressed look, and an action. Three buttons that light the board’s RGB LED red, green or blue.40 min
  1. Run it: three buttons
  2. Press GREEN
  3. The LED follows
  4. A miss
  5. Rename a button
  6. Good buttons
A WiFi clockJoin WiFi, ask a time server for the time with NTP, add a time zone, and show it in seven-segment digits. The network is simulated, and the lesson says exactly what that means.40 min
  1. Run it: joining WiFi
  2. Connected
  3. Ask a time server
  4. Big digits
  5. Your time zone
  6. Daylight saving

Materials

  • Cheap Yellow Display (ESP32-2432S028R)

Check for understanding

Each student finishes "A WiFi clock" 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: "Daylight saving".

Chapter 4. About 55 min

Project

A touch remote: a space mission panel.

LessonTimeWhat students do
Project: a space mission panelA touch remote for a rocket: ARM, LAUNCH and ABORT buttons drive a safe, armed, countdown and liftoff state machine, light the LED, and send every command over serial.55 min
  1. Run it: mission control
  2. Safe
  3. Try to launch
  4. Arm it
  5. Countdown and liftoff
  6. Abort
  7. A longer countdown
  8. Ship it

Materials

  • Cheap Yellow Display (ESP32-2432S028R)

Check for understanding

Each student finishes "Project: a space mission panel" 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: "Ship it".

Your class

Teach this unit as a class

Start a class from this course and its 7 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.