Difference between revisions of "ECE434 Project - Connect 4"

From eLinux.org
Jump to: navigation, search
(Conclusions)
(Theory of Operation)
 
(13 intermediate revisions by the same user not shown)
Line 27: Line 27:
 
== Executive Summary ==
 
== Executive Summary ==
  
Picture that summarizes the project.
+
[[File:Connect4.jpg|720px|frameless]]
  
My project involves using an 8x8 led matrix with Beaglebone to play Connect 4. The game will be able to be played directly using rotary encoders and buttons on the breadboard.
+
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.
 
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.
Line 38: Line 38:
  
 
== Packaging ==
 
== Packaging ==
If you have hardware, consider [http://cpprojects.blogspot.com/2013/07/small-build-big-execuition.html Small Build, Big Execuition] for ideas on the final 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 ==
 
== Installation Instructions ==
  
Give step by step instructions on how to install your project.
+
1) Ssh into your Beaglebone and ensure it is connected to the internet.
  
* Include your [https://github.com/ github] path as a link like this to the read-only git site[https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  
+
2) Clone the following git repo with:
* Be sure your README.md is includes an up-to-date and clear description of your project so that someone who comes across you git repository can quickly learn what you did and how they can reproduce it.
+
 
* Include a Makefile for your code if using C.
+
  bone$ '''git clone https://github.com/craannj/ECE434-connect4.git'''
* Include any additional packages installed via '''apt'''. Include '''install.sh''' and '''setup.sh''' files.
+
 
* Include kernel mods.
+
If the Adafruit Beaglebone IO Python Library is not already installed, install it with install.sh:
* If there is extra hardware needed, include links to where it can be obtained.
+
 
 +
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 ==
 
== User Instructions ==
  
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.
+
Once everything is installed you can run the pin configuration and then run the program.
  
Consider making it autostart for full credit.
+
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 ==
 
== Highlights ==
  
Here is where you brag about what your project can do.
+
Here is a [https://www.youtube.com/watch?v=IWSWtUvwh3k demo] of the Beaglebone running the Connect 4 game.
 
 
Include a [http://www.youtube.com/ YouTube] demo the audio description.
 
  
 
== Theory of Operation ==
 
== 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.
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.
 
  
 
== Work Breakdown ==
 
== Work Breakdown ==
  
List the major tasks in your project and who did what.
+
This was a solo project so all work was done individual.
 
+
This includes:
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.
+
* 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 ==
 
== Future Work ==
Line 84: Line 102:
 
== Conclusions ==
 
== 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.
+
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.
  
 
{{YoderFoot}}
 
{{YoderFoot}}

Latest revision as of 09:33, 17 November 2021

thumb‎ Embedded Linux Class by Mark A. Yoder


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

Connect4.jpg

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.




thumb‎ Embedded Linux Class by Mark A. Yoder