Hacks

A Colorful Way To Play Chess On An ATmega328

A Colorful Way To Play Chess On An ATmega328


We’ve all seen those chess computers that consist out of a physical playing field, and a built-in computer that would indicate where you should put its pieces while inputting the position of your pieces in some way. These systems are usually found in a dusty cardboard box in a back room’s closet, as playing like this is fairly cumbersome, and a lot depends on the built-in chess computer.

This take by [andrei.erdei] on this decades-old concept involves an ATmega328p-based Arduino Pro Mini board, a nice wooden frame, and 4 WS2812-based 65×65 mm RGB 8×8 LED matrices, as well as some TTP223 touch sensors that allow one to control the on-board cursor. This is the sole form of input: using the UP and RIGHT buttons to select the piece to move, confirm with OK, then move to the new position. The chess program will then calculate its next position and indicate it on the LED matrix.

Using physical chess pieces isn’t required either: each 4×4 grid uses a special pattern that indicates the piece that occupies it.  This makes it highly portable, but perhaps not as fun as using physical pieces. It also kills the sheer joy of building up that collection of enemy pieces when you’ve hit that winning streak. You can look at the embedded gameplay video after the break and judge for yourself.

At the core of the chess program is [H.G. Muller]’s micro-Max project. Originally ported to the Arduino Uno, this program outputs the game to the serial port. After tweaking it to use the LED matrix instead, [andrei.erdei] was then faced with the lack of memory on the board for the most common LED libraries. In the end, the FAB_LED library managed to perform the task with less memory, allowing it and the rest of the program to fit comfortably into the glorious 2 kB of SRAM that the ATmega328p provides.

Classic 8-bit chess engines are marvels of software engineering. Ever wonder how they stack up against modern chess software? Check out this article!



Source link

Click to add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Hacks

More in Hacks

7 Digestive Supplements for Enhanced Digestion

HCSeptember 21, 2019

Pew Pew in the Palm of Your Hand

HCSeptember 20, 2019

How to Control Anxiety and Calm Your Anxious Thoughts

HCSeptember 19, 2019

Linux Fu: Shell Scripts in C, C++, and Others

HCSeptember 18, 2019

17 Ways for Building Resilience and Staying Tough

HCSeptember 17, 2019

Scratch Built Media Player Channels 1980s Design

HCSeptember 16, 2019

Copyright © HurtCafe.com 2016

Do NOT follow this link or you will be banned from the site!