Skip to content

jackHorwell/automatedChessBoard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 

Repository files navigation

ChessMate

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


main.py

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


charlieplexing.py

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

TODO

  • 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

About

Code for a chess program that runs on a physical board

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages