The code starts by zeroing both stepper motors and returning the electromagnet to position A1 on the board. The serial monitor will prompt the first player to enter the square address of the piece to be moved, and the location for the piece to be moved to. The magnet moves to the first square, turns on the magnet, and then moves to the next specified square.
When the piece is being moved, the magnet will initially offset to the corner and then move along the lines between squares, which allows pieces to be moved around each other without colliding (for example, this allows the knight to be moved without having to first move the pawns in front of it)