-
-
Notifications
You must be signed in to change notification settings - Fork 3
Usage.md
Trent M. Wyatt edited this page Apr 21, 2025
·
1 revision
This guide explains how to use MicroChess after setting it up on your Arduino board. MicroChess allows you to watch the engine play against itself, observe the game on an 8x8 LED strip, or interact with the game via the Arduino Serial Monitor by entering moves in algebraic notation.
- MicroChess is installed and uploaded to your Arduino (see Installation).
- The Serial Monitor is open in the Arduino IDE (baud rate: 9600).
- (Optional) An 8x8 LED strip is connected for visual display.
- Power On the Arduino: Connect your Arduino to your computer via USB or a power source. The MicroChess sketch starts automatically.
-
Open the Serial Monitor:
- In the Arduino IDE, go to Tools > Serial Monitor or press
Ctrl+Shift+M. - Set the baud rate to 9600.
- You’ll see the initial chess board printed as text (e.g., ranks 1-8, files a-h) and a prompt for input.
- In the Arduino IDE, go to Tools > Serial Monitor or press
-
Observe the LED Strip (Optional):
- If connected, the 8x8 LED strip displays the current board state, with pieces represented by different colors (configured in
led_strip.cpp). - The board updates in real-time as moves are made.
- If connected, the 8x8 LED strip displays the current board state, with pieces represented by different colors (configured in
MicroChess supports two primary modes:
- By default, MicroChess runs in a mode where the engine plays both sides (white and black).
- The engine uses minimax with alpha-beta pruning to select moves, configured by settings in
options.h(e.g., search depth). -
Serial Monitor Output:
- Each move is printed in algebraic notation (e.g., "e2e4", "g8f6").
- The updated board state is displayed after each move.
-
LED Strip Output:
- The board on the LED strip updates to reflect each move, showing piece positions.
- To observe, simply watch the Serial Monitor or LED strip without inputting commands.
- You can interact with MicroChess by entering moves via the Serial Monitor.
-
Steps:
- Wait for the prompt (e.g., "Enter move for White:").
- Type a move in standard algebraic notation (e.g., "e2e4" to move a pawn from e2 to e4) and press Enter.
- The engine validates the move, updates the board, and responds with its move for the opposing side.
- Continue entering moves to play against the engine.
-
Special Moves:
- Castling: Enter "O-O" (kingside) or "O-O-O" (queenside).
- Pawn Promotion: Append the piece type (e.g., "e7e8q" for promotion to a queen).
- En Passant: Enter the move as it occurs (e.g., "e5d6" to capture en passant).
- Error Handling: If an invalid move is entered, the Serial Monitor displays an error (e.g., "Illegal move") and prompts again.
- Serial Monitor shows:
MicroChess | GitHub Repository | License: MIT | Contributing
© 2025 Trent M. Wyatt. All rights reserved.