Daniel Botchway

ProjectsFig. 03

PyCode

PyCode teaches Python as a game. It was our end-of-semester project: each level gives you a task and three minutes to write the code, then runs it, checks it and scores it with stars. Next to the screen sits a small box on an Arduino Nano that counts the level down on an OLED and shows the result with three LEDs and a buzzer, all driven by the game over one USB cable.

Year
2025
Discipline
Educational game
Role
End-of-semester project in a team of four
Tools
Unity (C#), Arduino Nano, OLED display, serial over USB
Code
github.com/08ops/PyCode_Work

Photographs

03Drag or use the arrows. Select the middle photograph to enlarge it.

Plate 01 / 03The game’s main menu in the Unity editor, with the desk timer idle in front.

Gameplay video

The game being played with the timer box beside it, from the post I shared when the project was finished. The levels run from printing “Hello, World!” to variables and loops; each answer is run, checked and scored with stars, and the box mirrors the result with its lights and buzzer.

How to read this pageScroll and the drawing builds itself chapter by chapter. Underlined words point at parts. Drag the drawing to turn it.

01 / 05

A Python lesson with a clock on the desk

PyCode is a Unity game with a tutorial and five levels, from printing “Hello, World!” to variables and loops. You type Python into the game’s editor and it runs, checks and scores your answer. The clock is not only on screen: a small box on the desk shows the time left on its display and answers with its lights and buzzer.

02 / 05

Inside the box

An Arduino Nano sits in socket strips on a perfboard with a buzzer. Jumper wires run up to the OLED display behind the window in the front panel and to the three LEDs that poke through the lid. The USB cable powers the board and carries the game’s commands.

03 / 05

One cable, four commands

When the game starts it scans the serial ports and sends IDENTIFY; the board answers MyGameBoard, so the game finds it on its own. From then on the game speaks in short lines at 115200 baud: START 180 when a level begins, PAUSE and RESUME from the pause menu, and RESET when you pass or fail. The Nano keeps its own countdown, so the box stays in step with the game.

04 / 05

Countdown, lights and buzzer

Once a level starts, the display counts down from 3:00 with a bar that empties as time runs out. When you pass, the LEDs light up one per star and the buzzer plays a tone for each, so the score is something you see and hear, not only read. The panel follows two levels, sped up: one passed with three stars, one where time runs out.

05 / 05

Parts list

Every part in the drawing. Hover a row to find it.

No.PartSpecificationQty
1Arduino NanoRuns the countdown; USB for power and serial1
2OLED displayTime left, state and a progress bar1
3LEDsGreen, red and yellow; one per star3
4BuzzerStart beep and a tone per star1
5PerfboardNano in socket strips, buzzer soldered1
6Jumper wiresTo the display and the LEDs8
7EnclosureCard box wrapped in tape1
8Front panelWindow for the display1
9USB cableTo the PC running the game1

Specifications

GameUnity (C#): tutorial, five levels, grading of the Python you type, star ratings
Level timer3 minutes per level, kept in the game and on the box
LinkUSB serial at 115200 baud; the board identifies itself as MyGameBoard
CommandsSTART 180, PAUSE, RESUME, RESET
FeedbackLEDs show the star rating; the buzzer plays matching tones
Timer hardwareArduino Nano, OLED display, three LEDs, buzzer, on a perfboard in a card box

Outcome

The prototype does what we set out to do: beginners learn by playing, and the game and the box behave as one. Starting a level starts the countdown on the desk, pausing the game pauses the box, and a pass lights the stars and plays their tones. Putting the clock and the score in the room, not only on the screen, makes the cause and effect of code easy to feel.

Contact

Get in touch

I welcome conversations about internships, research collaborations and robotics competitions.

botchwaydanielkwekudade@gmail.com

LinkedInGitHub

Phone
+233 53 808 0342
Location
Accra, Ghana