Learning To Count To 5 With a Raspberry Pi

Prototyping a small counting game – pressing a button to count up to 5 with LEDs and on an OLED screen – then celebrating once reached.

My daughter loves to help me build simple circuits, turning LED lights on and off on a breadboard. Not yet grasping her 1-2-3’s or A-B-C’s, I thought building a small game would be an engaging way to get her learning with the things she likes.

To put this together I used the following setup:

Wired as so:

By no means am I a Python developer, so I’m just swinging away here – the codes very repetitive, but hey, it does the trick easy enough.

Run the script with python3 oled-count-game.py. If the script fails and you get a warning about missing modules, the modules can be installed usually with sudo pip3 install <module_name>, for the GPIO if that’s missing, it can be installed with sudo apt-get install python3-rpi.gpio --assume-yes.

Leave a Reply