Chessboard-Hardware | Chessboard-Design | Chessboard-Nano | Chessboard-Pi
Arduino Nano firmware for a magnetic-piece-tracking digital chessboard! WIP
This repository contains the PlatformIO project for the firmware that goes on the Arduino Nano.
All these commands are available over serial with the default baud rate of 9600.
Prints the values of the linear hall sensors or the calibration values.
[type?]is the type to print (optional) and should be one of the following:piecesprints the current state of the chessboard. (default)piecesDebugprints the current state of the chessboard with debugrawprints the raw values of the linear hall sensors.presentCalibrationprints the calibration values for squares with a piece present.presentCalibrationEEPROMprints the calibration values for squares with a piece present stored in EEPROM.emptyCalibrationprints the calibration values for squares with no piece present.emptyCalibrationEEPROMprints the calibration values for squares with no piece present stored in EEPROM.presentCalibrationMarginprints the calibration margin values for squares with a piece present.presentCalibrationMarginEEPROMprints the calibration margin values for squares with a piece present stored in EEPROM.emptyCalibrationMarginprints the calibration margin values for squares with no piece present.emptyCalibrationMarginEEPROMprints the calibration margin values for squares with no piece present stored in EEPROM.allprints all of the above.
Gets or sets the calibration value or margins for squares.
[type]is the type of calibration to get or set and should be one of the following:presentfor squares with a piece present.emptyfor squares with no piece present.presentMarginfor squares with a piece present. (to account for noise)emptyMarginfor squares with no piece present. (to account for noise)
[action]is the action to perform and should be one of the following:getto get the calibration value.setto set the calibration value.
[position]is the position of the square and should be one of the following formats:row,colfor the row and column of the square. (0-indexed) Use 255 to change the entire row/column.globalto get or set all at the same time.
[value?]is the value to set the calibration value to. (optional) This is only used if[action]isset. If not provided, the value will be set to the current value of the square.
Saves the calibration values to EEPROM.
[type]is the type of calibration to save and should be one of the following:presentfor squares with a piece present.emptyfor squares with no piece present.presentMarginfor squares with a piece present. (to account for noise)emptyMarginfor squares with no piece present. (to account for noise)allto save all of the above.
Loads the calibration values from EEPROM.
[type]is the type of calibration to load and should be one of the following:presentfor squares with a piece present.emptyfor squares with no piece present.presentMarginfor squares with a piece present. (to account for noise)emptyMarginfor squares with no piece present. (to account for noise)allto load all of the above.
Gets or sets the settings values. These changes are automatically loaded and written to EEPROM and take effect immediately.
[action]is the action to perform and should be one of the following:getto get the settings value.setto set the settings value.
[key]is the key of the setting to get or set and should be one of the following:AUTO_LOAD_CALIBRATION- 0: Don't automatically load calibration from EEPROM on startup.
- 1: Automatically load calibration from EEPROM on startup.
DETECTION_METHOD- 0: Check for both the square to be not empty and present.
- 1: Check for the square to be not empty.
- 2: Check for the square to be present.
- 3: Check for either the square to be not empty or present.
PRINT_ON_BOARD_CHANGE- 0: Don't automatically print the board state when it changes.
- 1: Automatically print the board state when it changes.
[value?]is the value to set the settings value to. (optional) This is only required if[action]isset.