Difference between revisions of "ECE434 Project - Arcade Stacker"

From eLinux.org
Jump to: navigation, search
m
 
(10 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[Category:ECE497 |PT]]
 
 
[[Category:ECE434Fall2022 |PT]]
 
[[Category:ECE434Fall2022 |PT]]
 
{{YoderHead}}
 
{{YoderHead}}
  
 
Team members: Luke Wendel and Josh Mitterling
 
Team members: Luke Wendel and Josh Mitterling
 
== Grading Template ==
 
I'm using the following template to grade.  Each slot is 10 points.
 
0 = Missing, 5=OK, 10=Wow!
 
 
<pre style="color:red">
 
Add Extras
 
 
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
 
</pre>
 
  
 
== Executive Summary ==
 
== Executive Summary ==
 
+
[[File:Cover_pic.jpeg|400px]]
* insert picture here *
 
  
 
This project is a recreation of a common arcade game known as Stacker, in which rows of blocks bounce horizontally across the screen. The goal of the game is to stack the moving blocks row by row to the top of the screen, without dropping all of the blocks. We implemented the game using an LED matrix, a BeagleBone Black, and a pushbutton for user input.
 
This project is a recreation of a common arcade game known as Stacker, in which rows of blocks bounce horizontally across the screen. The goal of the game is to stack the moving blocks row by row to the top of the screen, without dropping all of the blocks. We implemented the game using an LED matrix, a BeagleBone Black, and a pushbutton for user input.
Line 46: Line 22:
 
We do not have any packaging. The BB Black, pushbutton, and LED matrix are bread boarded.  
 
We do not have any packaging. The BB Black, pushbutton, and LED matrix are bread boarded.  
  
== Installation Instructions TODO ==
+
== Installation Instructions ==
 
Hardware needs:  
 
Hardware needs:  
 
* BeagleBone Black
 
* BeagleBone Black
Line 55: Line 31:
  
 
How to install the project:  
 
How to install the project:  
 +
* Building the circuit
 +
[[File:Circuit_diagram.jpeg|400px]]
 +
 +
Recreate the above circuit using the components you've acquired. The LED matrix requires 5V power, a ground (GND) connection, serial clock (SCL), and serial data (SDA) connections. The I2C pins on the BeagleBone Black can be seen on the pinout diagram below. They are P9_19 and P9_20 for SCL and SDA respectively. Connect the ground rail of your breadboard to pin 2 of the P9 header on the BeagleBone. Connect 5V power (pin 3), to the power rail on your breadboard. And finally, connect a gpio pin (we used P9_23, or GPIO_49) to one side of the pushbutton, and connect the other side of the button to ground. And your circuit is now complete.
  
 
Go to our [https://github.com/rhit-wendella/Stack_game_project.git github repository] and clone it. The README file should include the setup and installation scripts.
 
Go to our [https://github.com/rhit-wendella/Stack_game_project.git github repository] and clone it. The README file should include the setup and installation scripts.
  
* Be sure your README.md is includes an up-to-date and clear description of your project
+
The only python package needed to be installed is the Adafruit GPIO package, and the installation is handled by the install.sh file. The setup.sh file configures the IO and I2C of the BeagleBone for execution of the python file.
* Include any additional packages installed via '''apt'''.  Include '''install.sh''' and '''setup.sh''' files.
 
 
 
== User Instructions TODO ==
 
1. open the files
 
2. play the game
 
  
== Highlights TODO ==
+
== User Instructions ==
 +
* Once the programs are downloaded and the setup has been run, open the Stack_game_project directory. you should already be there from running the setup.sh file
 +
* you can then run the python script by running python and the Arcade_games.py file in the terminal. if you're using a debian installation on the BeagleBone, python is probably in the /usr/bin folder, so the command will look something like this:
 +
* $/usr/bin/python /Stack_game_project/Arcade_games.py
 +
* if you did it successfully, your LED matrix should have a bar scrolling at the bottom, which means your game is running, so press the button on your breadboard to stop the bar, and press it again to stack blocks atop the stack
  
Here is where you brag about what your project can do.
+
== Highlights ==
 +
* Our program implements an Interrupt Service Routine (ISR) using a button interrupt for the user input
 +
* The program can play the game over and over again until you break it. No need to run the program again to run the game back
 +
* The matrix will display a special sequence when you win the game
 +
* there is an easter egg programmed in for when you win the game with no blocks lost
 +
* it works
  
Include a [http://www.youtube.com/ YouTube] demo the audio description.
+
[https://youtu.be/-JKpZJbED3E Here's a link] to a video explaining how our project works and some of its cool features.
  
 
== Theory of Operation ==
 
== Theory of Operation ==
Line 78: Line 62:
  
 
[[File:Program_flowchart.PNG|1000px]]
 
[[File:Program_flowchart.PNG|1000px]]
 +
 
The operation can be represented as a state machine, where the push of a button changes the idle state to an action state. In the action state, the program will determine the blocks stacked, check the game winning condition, and check the game loss condition.
 
The operation can be represented as a state machine, where the push of a button changes the idle state to an action state. In the action state, the program will determine the blocks stacked, check the game winning condition, and check the game loss condition.
  

Latest revision as of 14:20, 27 November 2023

thumb‎ Embedded Linux Class by Mark A. Yoder


Team members: Luke Wendel and Josh Mitterling

Executive Summary

Cover pic.jpeg

This project is a recreation of a common arcade game known as Stacker, in which rows of blocks bounce horizontally across the screen. The goal of the game is to stack the moving blocks row by row to the top of the screen, without dropping all of the blocks. We implemented the game using an LED matrix, a BeagleBone Black, and a pushbutton for user input.

What works:

  • User Input device (pushbutton)
  • 8x8 LED Matrix
  • Playable Stacker game

What doesn’t work:

  • 64x32 LED Matrix (Unsuccessfully implemented. After hours of debugging, its behavior did not begin to match what was expected.)

In the end, we were able to produce a nostalgic mini-version of the Stacker arcade game. It's a fairly straightforward project, which leaves a lot of opportunity for further development and interesting add-ons for us or others who find the project interesting.

Packaging

We do not have any packaging. The BB Black, pushbutton, and LED matrix are bread boarded.

Installation Instructions

Hardware needs:

Any buttons you can tack on a breadboard will work. As will any breadboard and corresponding wires. The LED matrix we used is linked above. No kernel mods were used.

How to install the project:

  • Building the circuit

Circuit diagram.jpeg

Recreate the above circuit using the components you've acquired. The LED matrix requires 5V power, a ground (GND) connection, serial clock (SCL), and serial data (SDA) connections. The I2C pins on the BeagleBone Black can be seen on the pinout diagram below. They are P9_19 and P9_20 for SCL and SDA respectively. Connect the ground rail of your breadboard to pin 2 of the P9 header on the BeagleBone. Connect 5V power (pin 3), to the power rail on your breadboard. And finally, connect a gpio pin (we used P9_23, or GPIO_49) to one side of the pushbutton, and connect the other side of the button to ground. And your circuit is now complete.

Go to our github repository and clone it. The README file should include the setup and installation scripts.

The only python package needed to be installed is the Adafruit GPIO package, and the installation is handled by the install.sh file. The setup.sh file configures the IO and I2C of the BeagleBone for execution of the python file.

User Instructions

  • Once the programs are downloaded and the setup has been run, open the Stack_game_project directory. you should already be there from running the setup.sh file
  • you can then run the python script by running python and the Arcade_games.py file in the terminal. if you're using a debian installation on the BeagleBone, python is probably in the /usr/bin folder, so the command will look something like this:
  • $/usr/bin/python /Stack_game_project/Arcade_games.py
  • if you did it successfully, your LED matrix should have a bar scrolling at the bottom, which means your game is running, so press the button on your breadboard to stop the bar, and press it again to stack blocks atop the stack

Highlights

  • Our program implements an Interrupt Service Routine (ISR) using a button interrupt for the user input
  • The program can play the game over and over again until you break it. No need to run the program again to run the game back
  • The matrix will display a special sequence when you win the game
  • there is an easter egg programmed in for when you win the game with no blocks lost
  • it works

Here's a link to a video explaining how our project works and some of its cool features.

Theory of Operation

At initialization, the software connects to the peripheral display device.

This figure visually describes the game flow:

Program flowchart.PNG

The operation can be represented as a state machine, where the push of a button changes the idle state to an action state. In the action state, the program will determine the blocks stacked, check the game winning condition, and check the game loss condition.

Work Breakdown

We have worked together throughout our undergraduate experience, so it's easy to collaborate and connect our ideas together. Much of the work was done together, but one of us was more responsible for each of the following tasks:

  • Wiring up the 64x32 LED matrix, managing the IO and headers - Josh
  • Developing the initial driver for the 64x32 LED matrix - Luke
  • Developing the Stacker game logic and program flow - Josh
  • Implementing the logic and constructing a template file - Luke

We worked together, by pair programming, to debug the program and get the game to a playable state.

Work not done yet: Migrating the game to the 64x32 LED matrix to be playable.

Future Work

This project is a straightforward example of controlling user input devices to play a fun game. More games = more fun, so having a way to select a variety of different games on an LED Matrix, ideally of a larger size and higher resolution, would be very cool. We would start by adding Tetris as a second playable game, and go from there.

Conclusions

We have a working game of Stacker in minigame form on the BeagleBone Black. This smaller version provides a bit of a nostalgic experience, and it was a good opportunity to get even more familiar with the Beagle Bone Black as a microcontroller and embedded linux platform. It required much collaboration, flexibility and debugging. We hope that anyone who stumbles upon this project finds it interesting, but there are a few more things we would have liked to do in furtherance of that aim. The first possibility would have been a second LED matrix that offers a multiplayer experience, where 2 players race to finish Stacking. As mentioned earlier, a second game, maybe mini-Tetris would have been nice. Or at least a few cosmetic upgrades (a bigger pushbutton, packaging, etc).




thumb‎ Embedded Linux Class by Mark A. Yoder