Solving the 8-Queens Puzzle with an Adafruit 8×8 Mini LED Matrix

Dennis wrote in to share a project that students at Storming Robots have been working on.

Received an Adafruit Mini 8×8 LED Matrix w/I2C Backpack today.  After soldering and testing I wanted to try something else with it.

Some students here have been programming the classic 8-Queens puzzle where 8 queens must be placed on a chess board such that no two queens can take each other.  I thought the 8×8 matrix would make a good ‘chessboard’.  Each lit LED is a placement for a queen in a particular solution.  I have it hooked up to a large “breadboard Arduino” that I like using for testing things out. Naturally this will work with an Uno/Mega just fine.  For more info on the 8-Queens problem see the Wikipedia article.

Note: It runs through the 92 solutions pretty fast.  I was hand holding the camera and didn’t want to make the video too long.  I might post a video later with a longer delay between solutions.

Be sure to check out Storming Robots.  This looks like an amazing school in New Jersey!

What’s better than a single LED? Lots of LEDs! A fun way to make a small display is to use an 8×8 matrix or a 4-digit 7-segment display. Matrices like these are ‘multiplexed’ – so to control 64 LEDs you need 16 pins. That’s a lot of pins, and there are driver chips like the MAX7219 that can control a matrix for you but there’s a lot of wiring to set up and they take up a ton of space. Here at Adafruit we feel your pain! After all, wouldn’t it be awesome if you could control a matrix without tons of wiring? That’s where these adorable LED matrix backpacks come in. We have them in two flavors – a mini 8×8 and a 4-digit 0.56″ 7-segment. They work perfectly with the matrices we stock in the Adafruit shop and make adding a bright little display trivial.

In Stock and Shipping Now!


Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7:30pm ET! To join, head over to YouTube and check out the show’s live chat and our Discord!

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Join over 38,000+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord

CircuitPython – The easiest way to program microcontrollers – CircuitPython.org


New Products – Adafruit Industries – Makers, hackers, artists, designers and engineers! — New Products 11/15/2024 Featuring Adafruit bq25185 USB / DC / Solar Charger with 3.3V Buck Board! (Video)

Python for Microcontrollers – Adafruit Daily — Python on Microcontrollers Newsletter: A New Arduino MicroPython Package Manager, How-Tos and Much More! #CircuitPython #Python #micropython @ThePSF @Raspberry_Pi

EYE on NPI – Adafruit Daily — EYE on NPI Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey

Adafruit IoT Monthly — The 2024 Recap Issue!

Maker Business – Adafruit Daily — Apple to build another chip at TSMC Arizona

Electronics – Adafruit Daily — SMT Tip – Stop moving around!

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !


No Comments

No comments yet.

Sorry, the comment form is closed at this time.