-
-
Notifications
You must be signed in to change notification settings - Fork 3
FAQ.md
This page addresses common questions about MicroChess, a compact chess engine for Arduino with less than 2K RAM. If your question isn’t answered here, please submit it to the GitHub Issues page.
MicroChess is an open-source chess engine designed for Arduino boards, implementing full chess rules (including castling, en passant, and promotion) within strict memory constraints (2K RAM, 32K flash). It uses minimax with alpha-beta pruning and displays the game on an 8x8 LED strip or Serial Monitor.
It’s for Arduino hobbyists, chess enthusiasts, educators, students, and developers interested in embedded systems, game programming, or algorithm optimization.
- An Arduino board (e.g., Uno, Nano).
- (Optional) An 8x8 LED strip or matrix compatible with the FastLED library.
- A computer with the Arduino IDE and a USB cable.
Follow the Installation guide to:
- Clone or download the repository.
- Install the Arduino IDE and FastLED library.
- Open
MicroChess.ino, connect your Arduino, and upload the sketch.
- Ensure the FastLED library is installed and the LED strip is connected correctly (e.g., data pin 6).
- Verify the LED type (e.g., WS2812B) matches
led_strip.cppsettings. - Check power supply adequacy for the LED strip.
- Confirm the baud rate is 9600 (Tools > Serial Monitor).
- Ensure the correct port is selected and the Arduino is powered.
- Verify the sketch was uploaded successfully.
- Open the Serial Monitor (baud rate: 9600).
- Enter moves in algebraic notation (e.g., "e2e4") when prompted.
- The engine responds with its move. See Usage for details.
Yes, by default, MicroChess plays both sides. Watch the LED strip or Serial Monitor to see moves and board updates. No input is needed unless you want to intervene.
- Castling: Enter "O-O" (kingside) or "O-O-O" (queenside).
- En Passant: Enter the capture move (e.g., "e5d6").
- Pawn Promotion: Append the piece type (e.g., "e7e8q" for queen).
- Check your move format (e.g., "e2e4", not "E4" or "e4").
- Ensure the move is legal (e.g., not moving a pinned piece or into check).
- Verify it’s your turn (white or black).
- Uses bit fields in
board_tandmove_tfor compact storage. - Employs lightweight evaluation heuristics and limited search depth (3-5 plies).
- Minimizes variable usage in
game_t,options_t, andstats_t.
Yes, modify settings in options.h (see Options):
- Reduce
default_depth(e.g., 2 plies) for a weaker engine. - Lower
default_time_limit(e.g., 500ms) for faster, less accurate moves.
- Set verbosity to
DEBUGinoptions.hto log metrics (nodes searched, time taken). - Check Statistics for performance data via
stats_t. - Run unit tests in
test/unit_test_001.cpp(see Testing).
- Search: Minimax with alpha-beta pruning (see Search Algorithm).
- Evaluation: Material and positional scoring (see Evaluation).
- Move Generation: Optimized for all piece types and special moves (see Move Generation).
- Submit bug reports or feature requests via GitHub Issues.
- Propose code, documentation, or test improvements via pull requests.
- See Contributing for guidelines.
Yes, propose features via GitHub Issues. Ensure they fit within 2K RAM and 32K flash, and add corresponding unit tests.
For context:
- LED Strip: Board display demo (see MicroChessSmall.gif).
- Serial Console: Move and board output (see MicroChessConsole2.gif). More details are in the Visuals page.
- See Changelog for version history.
- Explore Contributing for how to get involved.
- Check Code Structure for an overview of all files.
MicroChess | GitHub Repository | License: MIT | Contributing
© 2025 Trent M. Wyatt. All rights reserved.