-
Update: Bug fix, game rule update, new PCB revision
12/23/2024 at 19:15 • 0 commentsI discovered a bug in the program while playing electronic mancala today. After debugging for a bit, I discovered that the byte storing the data for player 2 was improper and did not contain the right sum at the end of the game. I determined that this was due to an uninitialized local variable in the sum function that tallies up the final score. I set this sum variable to zero and the code now seems to be working as intended.
The initial program was designed with a game rule that I discovered was just a house rule that I've always played with i.e. captures do not remove your own piece, only capturing the opponent's pieces. The game rules have now been updated to reflect the traditional mancala rules.
I'm planning to re-spin the PCB to change out the PIC18LF2420 microcontroller with an ATSAMD21 in the future. This new PCB revision will also include a small digital display for better displaying game data. I plan on starting this in the new year.