Source: https://mokxi.com/teachers/plans/build-a-slot-machine
Updated: 2026-11-11

Lesson plan

# Build a slot machine lesson plan

Pull a real arcade lever, spin three OLED reels and pay out by a table whose odds you can check, on an Uno.

2 chapters, 4 lessons, about 4 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

- Read the lever once per pull, and draw a reel that spins.
- Three reels on three buses, then credits, bets and honest odds.

### Materials for the whole unit

- Addressable RGB LEDs
- Arcade button x 3
- Arcade joystick lever
- Arduino Uno R3
- Full-size breadboard
- OLED display, 128x64 x 3
- Piezo speaker

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

## Lever and reel

Read the lever once per pull, and draw a reel that spins.

Lesson | Time | What students do

Slot machine: the lever A real arcade lever on an Uno. Read its DOWN switch, count each pull exactly once on its edge, and give it a click you can hear. | 55 min

- Four switches in a stick
- Pull it
- Watch the pin
- Give it a click

Slot machine: one reel Draw a spinning reel on an SSD1306 with no frame buffer, then let the lever pick where it stops. Animation that fits in an Uno. | 55 min

- A reel on a screen
- No frame buffer
- Spin
- The clunk

### Materials

- Arcade joystick lever
- Arduino Uno R3
- Full-size breadboard
- OLED display, 128x64
- Piezo speaker

### Check for understanding

Each student finishes "Slot machine: one reel" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.

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

Chapter 2. About 2 h 15 min

## The machine

Three reels on three buses, then credits, bets and honest odds.

Lesson | Time | What students do

Slot machine: three reels Three OLEDs with the same address, each on its own pair of wires, and reels that stop one by one from left to right. | 55 min

- Three screens, one address
- All three drawn
- Pull, and watch them stop
- Read the line

Slot machine: the whole machine Coins, a bet, a pay table with odds you can check, win lights and sounds. The finished machine, and the math that keeps it honest. | 80 min

- The finished machine
- Drop a coin
- Set the bet
- Spin
- Get paid
- Out of credits

### Materials

- Addressable RGB LEDs
- Arcade button x 3
- Arcade joystick lever
- Arduino Uno R3
- Full-size breadboard
- OLED display, 128x64 x 3
- Piezo speaker

### Check for understanding

Each student finishes "Slot machine: the whole machine" 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: "Out of credits".

Your class

## Teach this unit as a class

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