Skip to content
Trent M. Wyatt edited this page Apr 21, 2025 · 1 revision

Frequently Asked Questions (FAQ)

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.

General Questions

What is MicroChess?

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.

Who is MicroChess for?

It’s for Arduino hobbyists, chess enthusiasts, educators, students, and developers interested in embedded systems, game programming, or algorithm optimization.

What hardware is required?

  • 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.

Setup and Installation

How do I install MicroChess?

Follow the Installation guide to:

  1. Clone or download the repository.
  2. Install the Arduino IDE and FastLED library.
  3. Open MicroChess.ino, connect your Arduino, and upload the sketch.

Why isn’t my LED strip working?

  • 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.cpp settings.
  • Check power supply adequacy for the LED strip.

Why is the Serial Monitor blank?

  • 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.

Usage

How do I play against MicroChess?

  • 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.

Can I watch the engine play itself?

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.

How do I input special moves?

  • 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).

Why do I get “Illegal move” errors?

  • 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).

Technical Questions

How does MicroChess fit in 2K RAM?

  • Uses bit fields in board_t and move_t for compact storage.
  • Employs lightweight evaluation heuristics and limited search depth (3-5 plies).
  • Minimizes variable usage in game_t, options_t, and stats_t.

Can I adjust the engine’s strength?

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.

How can I debug performance issues?

  • Set verbosity to DEBUG in options.h to 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).

What algorithms does MicroChess use?

  • 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).

Contributing

How can I contribute?

  • Submit bug reports or feature requests via GitHub Issues.
  • Propose code, documentation, or test improvements via pull requests.
  • See Contributing for guidelines.

Can I add new features?

Yes, propose features via GitHub Issues. Ensure they fit within 2K RAM and 32K flash, and add corresponding unit tests.

Visual Aids

For context:

Next Steps


Back to Home | Next: Changelog

Clone this wiki locally