Micro One-Armed Bandit

Andrew Smith’s Micro One-Armed Bandit is a micro slot machine complete with lights and sounds.

Jeremy Cook
2 months agoGaming / Lights

Slot machines in a casino are rather fascinating devices, with rows of brightly-colored icons that quickly move when played, and may or (more often) may not line up to signify a win. While one may argue whether the standard version of such machines is a bit of fun or a waste of money and time, Andrew Smith’s Micro One-Armed Bandit instead provides a colorful code and hardware learning opportunity, complete with sound effects (but without the monetary repercussions).

The little slot machine runs on an Adafruit QT Py SAMD21 development board, which powers a 5x5 NeoPixel Grid BFF Add-On, also by Adafruit. A microswitch is added for control, along with a piezo buzzer for sound effects. Everything is soldered together sans any sort of enclosure, and plugged into a USB-C cable. A right-angle USB connector makes a nice mount for the slot device, allowing it to easily sit on a desk or wherever is convenient while facing upward.

According to Smith’s writeup, working with the CircuitPython NeoPixel library to animate the 5x5 RGB matrix was one of the most interesting programming challenges for this project, and the audio-visual effect is quite nice. It’s especially satisfying to see the individual LEDs within the addressable LED units light up as the rows of pixels scroll down in the video. Slot action is started on the release of the lever, facilitated via Adafruit’s CircuitPython Debounce library.

Code is available on GitHub if you’d like to examine the coding techniques used or even duplicate the project.

Jeremy Cook
Engineer, maker of random contraptions, love learning about tech. Write for various publications, including Hackster!
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles