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.
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.
Lever and reel
Read the lever once per pull, and draw a reel that spins.
| Lesson | Time | What students do |
|---|---|---|
| Slot machine: the leverA 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 |
|
| Slot machine: one reelDraw 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 |
|
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".
The machine
Three reels on three buses, then credits, bets and honest odds.
| Lesson | Time | What students do |
|---|---|---|
| Slot machine: three reelsThree 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 |
|
| Slot machine: the whole machineCoins, 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 |
|
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".
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.