ECE434 Project - Connect 4

Team members: Nathaniel Craan

Grading Template
I'm using the following template to grade. Each slot is 10 points. 0 = Missing, 5=OK, 10=Wow!

 09 Executive Summary 09 Packaging 09 Installation Instructions 09 User Instructions 09 Highlights 09 Theory of Operation 09 Work Breakdown 09 Future Work/Conclusions 09 Hackster.io 09 Demo/Poster 00 Not Late

Score: 90/100

Executive Summary


My project involves using an 8x8 led matrix with the Beaglebone black to play Connect 4. The game will be able to be played directly using rotary encoders and buttons on the breadboard.

Connect 4 is fully playable using the rotary encoder, button, led matrix and accelerometer. The placement of pieces and detection of 4 in a row all functions as intended.

While the piece is dropping into place if there are any pieces of the same color already in the column they temporarily disappear until the piece is in its proper location. Once the piece is in place the pieces reappear so the game still functions as intended.

Overall, I was able to get the game functioning and meet the initial goals I had set. That being said there are many additions I would have added if I had more time to accomplish them.

Packaging
This project was made using a breadboard but could be adapted to fit onto a PCB that could then be fit into an enclosure.

Installation Instructions
1) Ssh into your Beaglebone and ensure it is connected to the internet.

2) Clone the following git repo with:

bone$ git clone https://github.com/craannj/ECE434-connect4.git

If the Adafruit Beaglebone IO Python Library is not already installed, install it with install.sh:

bone$ sudo install.sh

Or install it with these instructions:

bone$ sudo apt-get update bone$ sudo apt-get install build-essential python3-dev python3-pip -y bone$ sudo pip3 install Adafruit_BBIO

The hardware is all included in the ECE434 parts kit except for the red and green LEDs that are used.

User Instructions
Once everything is installed you can run the pin configuration and then run the program.

Configure the pins:

bone$ ./pinconfig.sh

Run the program:

bone$  sudo ./connect4final.py

Note: The program has to be run using sudo to allow for I2C to function as intended.

Highlights
Here is a demo of the Beaglebone running the Connect 4 game.

Theory of Operation
The python script functions in a loop and will keep running until the Beaglebone is powered of or the code is interrupted.

Work Breakdown
This was a solo project so all work was done individual. This includes:
 * Getting the matrix to function and incorporating piece movement.
 * Using the rotary encoder to select the column for the piece.
 * Incorporating the turn swapping function.
 * 4 in a row detection.
 * Clearing the board using the accelerometer.

Future Work
With more time I would have liked to incorporate these ideas:


 * Added functionality to play the game between two Beaglebones
 * Display the score between the two players
 * An option to play against a "computer" player
 * Interface the game with a webpage

Conclusions
My original goal was to create Connect 4 using an 8x8 led matrix. I was able to achieve that and added a number of additional effects that happen within the functionality of the game. If I had more time I would have tried to add more features but I am happy with how this project turned out.