Friday, May 4, 2018

Week 5


During the week 5 class, the group started off by soldering four wires onto the matrix driver. The group worked together to solder, one member doing two wires and the other two members each soldering one. These four wires allow the joystick to be connected. The connections can be shown in figure 1 and 2 below.

Figure 1.
An image showing the connections between the joystick and driver.

Figure 2.
An image showing the soldering connections on the driver.

The red wire connects to 5V, the black wire to ground, the blue wire to the third analog port (A3) for the x potentiometer, and the fifth analog port (A5) for the joystick button.

The group also worked on the program this week. As of the end of the week 5 class, the connect four game is playable, but the program does not yet recognize the winner of the game. It starts off with a blue light in the upper left corner, which moves left/right depending on player 1's movement of the joystick. When the button is pressed, the blue light cascades down the column to the last available space. Then it switches colors to red and does the same thing for player 2's turn. Eventually the program will be able to recognize when one of the players connects four of their color in a row. Figure 3 below shows a sample game, where player 1 (blue) has won (on the diagonal).

Figure 3.
A sample game of Connect Four where blue has won.