A chess program designed for a physical chessboard that uses reed switches to determine movement and LEDs to communicate computer movement.
Uses the Stockfish engine to generate and validate moves, Stockfish is open source software that can be run on linux and more specifically the Raspberry Pi 3. I'm using the stockfish python package to communicate between my program and the engine, this does not unfortunately support checking for check or stalemate so I will have to search for another module that take a board's current state and detect check or write my own.
I aim to develop a web application to go alongside this program
Contains the main game logic for the chess program, it can:
- Start a game
- Detect player movement
- Generate moves for AI
- Check the physical board is set up correctly
Called by the main program and contains functions to control the 16 LEDs via charlieplexing:
- turnOn - Takes an int from 0-16 as a parameter and turns on the given LED, passing 0 turns off any currently on LED as it calls an unused GPIO configuration
- allFlash - Flashes all LEDs three times
- slide - Lights up each LED one at a time in order, takes speed parameter either "fast" or "slow"
- bounce - Has the lights slide from one side to the other and goes in reverse once it reaches the end
- Prevent movement to same position - (completed)
- Flash LEDs when illegal move is made - (completed)
- Add promotion - (completed)
- Add castling - (completed)
- Add in taking a piece first then picking up own piece (in progress)
- Add LCD functionality and buttons (new file to control LCD?)
- Add difficulty settings for AI
- Get program to understand when board is in check/checkmate/stalemate
- Make program run on boot