Functions to read all patterns and reset board.