■ FIGURE 5. Testing the chessboard.
}
}
}
}
pathtoKingCount = 0;
// if we get here, checkmate
lcd.setCursor(0, 4);
lcd.print(““““CHECKMATE! “);
return true;
}
■ FIGURE 6. The LED chessboard on a wood table
made by my son.
Future Enhancements
Throughout the Teensy 3.1 chess program, there are
many lines that print to the serial monitor of the Arduino
GUI with the USB cord in place. These could be
eliminated from the program or commented out, but have
been left in place as they were helpful when debugging,
and will be informative to a user in understanding how the
program is operating. A number of functions were also
written that simply print information to the serial monitor
for debugging, such as printPaths(), printPiecesLoc(),
printPiecesVal(), and myDebug(). If you want to modify this
program, you should find these functions useful.
A possible enhancement to the existing code might
be suggesting moves to each player. Changing the
program to have the computer play against a person
would require a major effort. The computer used for this
could be the Teensy 3.1, or a PC could be interfaced to
the chessboard. Surprisingly, the Teensy 3.1 only uses
12% of its program space and 10% of its dynamic
memory for the software presented here, so there is lots
of room for additional code.
This project has given me a lot of satisfaction, and is
one of those where adding possible additions to the code
will be a challenging and interesting activity.
It’s your move now. NV
February 2017 23