Stackers Arcade Game

by:INDUSTRIAL-MAN     2019-09-12
Hi guys, today I would like to share with you an amazing arcade game that you can make with a bunch of Ws2812b LEDs and micro controller/FPGA.
Look at Stack Overflow-
Hardware implementation of classic arcade games.
When we started to spend more and more time developing our games and learning more from them, the beginning of a school project soon became a labor of love (
And ignore our learning xD in the process).
In the end, our game is very good-
Buildings and praise confiscated by our school (
As presentation materials for the next batch of students).
We can always build the second one.
Let\'s start!
Online version of the game: micro-controller/microcomputer/FPGA-
Implement the logic of our game with FPGA.
In our project, we need to use the Mojo FPGA board.
For people who are not started, it is a board that uses hardware instead of code to implement its functionality.
So I would say it\'s low level and completely different from using Arduino or Pi.
You have to write your own code if you use other boards, but this game is easy to code, Hey!
Now you can learn coding too! 2. Ws2812b LEDs -
Here we use LEDs to build display screens for our games.
If you haven\'t touched ws2812b before xD, you can\'t be a manufacturer.
This means that you can cut off a single LEDs and paste them into whatever shape you like.
This is the meaning of RGB, you can output any color you like.
Also, FastLED-
The Arduino library that controls Ws2812b is developed very well.
If you don\'t have an Arduino, I would suggest that people use an Arduino instead of an FPGA.
You can buy led from Taobao/Amazon but we purchased our led from Sim Lim tower in Singapore. 3. Wood -
For the outer case, we used 1 cm-
We used 0 thick plywood and LED matrix. 3cm-thick plywood.
We found our supply of waste wood from our school\'s fab Lab. 4.
Light diffusion acrylic-
For our screen we tried different types of acrylic and we found this frosted acrylic called PL-
422, this is very good for diffuse light.
If you can\'t find the exact model, try looking for frosted acrylic.
We bought it at Dama plastic in Singapore. 5. Foam Board -
In order to separate each pixel of the light, we need a grid structure, and this foam is the ideal material to do so. We bought 0. 5cm-
Thick foam board of our school bookstore. 6.
Big Red Button
OK, we don\'t have to have such a big red button, but it\'s always good to have a button for people to slam!
XD we bought it at Sim Lim tower in SingaporeTools:1. Wood Glue2.
Soldering Iron 3. Solder4. Wires.
This is the best if you have a soft wire compared to a harder one.
Single core compared to multi core. 5. Wire stripper6. Wire cutter7.
1mm drill bit. Scroll saw9.
Band saw debugging: 1.
Variable power unit 2.
For our project, we used a quick prototype before building the LED matrix and programming games.
The reason for this is that we don\'t want to build an LED matrix just to realize that our code doesn\'t work or that our game logic is flawed.
On the hardware side, in the first phase, we just tested the logic of moving the light pattern on our own simple LED matrix.
Once we test the logic to work properly, we go out and cut the bars of 5 Ws2812b LEDs just to test our game logic with different lines.
Once successful, we begin to manufacture the LED matrix on a large scale.
We also tested different acrylic resin samples with LED before settling PL-
422 as the best light diffuser.
For the separator structure, we also tested the different heights of the full diffusion of the LED.
In the end, we achieved a square of 3 cm * 3 cm with a height of 4 cm, which is the best choice for diffusion.
Based on this optimal size, we also decide the required plywood size for the 5x11 LED matrix by leaving 0.
There is a gap of 5 cm between the bubbles in the square. .
In terms of software, we try to be modular.
Before continuing to add the shift function, we first test whether the led can be lit and then test the other led.
If you don\'t, the result can be catastrophic.
When we try to code the whole game as a big chunk before realizing we can\'t debug the whole game, it\'s hard for us to understand that. Ouch!
For our case, we use the classic arcade feel and look.
First of all, we cut some thin plywood to quickly prototype the shape because it is easier and faster to cut thin plywood and test.
Once we are satisfied with our size and shape, we begin to build the shell using thicker plywood.
We used a band saw through thick plywood and a reel saw through thin plywood.
After that, we glued them together with glue.
For the back of the plywood, we wanted to have easy access to the electronics inside, so we made it into a lock --in-
Place items that can be easily removed at any time.
In order to connect the button, we first drew a circle of the diameter of the button micro-switch (
Bottom long part of button).
Then we drilled a hole near the edge and saw a circle with a rolling saw.
Then we put the button in.
We also cut a thin piece of plywood based on the size we calculated previously as the basis for the LED matrix.
Note: I apologize for not taking actionby-step process.
We didn\'t record the steps all the way, and the shell was completed when we realized we needed to record the steps.
The picture is not the final size either.
With the thin piece we cut before, we first draw a square based on our foam structure and draw a cross in the middle of the square to mark the position of each LED, as the place where we should paste the LED.
We then also drill 3 small holes on each side of the LED to let the wires go through and Weld to each LED. We daisy-
Connecting each line of LED through their data input and data output pins, we weld each GND and VCC to a normal wire.
The leading data in will generate a light pattern for each row and we connect it to the pin output of the micro controller/FPGA.
You can also weld the last data in one row to the leading data in the other.
The way the Ws2812b LED works is that each LED contains an IC that will take the required data from the wire and pass the rest of the data to the chain.
Our LED is based on another great note (
In fact, we did copy it! xD)
Here, we also want to emphasize the importance of using soft wires.
If you use a rigid hard wire in the pin as the leading data, it may pull out the copper liner on the Ws2812b every time you pull the wire, which will destroy it.
In this project, before we replaced the soft wire, we destroyed a total of 40 LEDs, accounting for 1/3 of the LEDs required for our project.
Instructable: Runs on sober high density lipids that are not the most popular languages.
We couldn\'t find any Ws2812b LED Library in Lucid, so we turned to writing our own library, which was a very interesting experience.
To this end, we first analyzed the signal transmitted using Arduino\'s FastLED library and wrote the code to copy the signal.
Here is a technique for hardware debugging, and the oscilloscope is very useful for analyzing signals, whether it is debugging signals that you are not sure about yourself or checking and copying other signals.
After writing the library for Ws2812b, we continue to write code for the game, we use the displacement bit function to move each block to the left and right, and move the bits and to and squares of each row to the previous row.
You can also consider implementing this in Arduino, which is not difficult.
We even coded the game screen for fun!
There are 2 levels of our game, which is a visible stacked game (Green)
And the second level invisible overlay game (Blue).
Even after we have the working code and the working LED matrix, sometimes we still have problems with flashing the lights or the lights should not be on.
The problem is usually caused by improper grounding, power level or interference.
Here you will need other hardware debugging tools such as variable power units to check if the power supply for Mojo/Arduino is sufficient or excessive.
In my experience, the working voltage range of Ws2812b is very wide from 2. 8v -5v.
Here I have a video showing the lights go crazy after I add power.
However, further inspection found that we had some incorrect welding after re-welding
Our problem is solved again.
There may also be problems with interference or crossover
But thankfully, we have never faced any of them.
Github code: by displacement: by bit AND: there is a shell and led matrix.
Now is the time to put everything together.
First we put the foam in front and the LED matrix in the back and adjust the position.
Because the foam has a high amount of friction, it is just a friction installation when the LED matrix is hot bonded in place.
After that, we put the screen in front of the grid.
Then we plug the pins of each line into the micro controller and start playing!
: What I like to do with this project is its flexibility and you can always re-program the micro controller to be part of another game and try to make animations or react games etc.
Hope you guys enjoy making this and learn something from it. GgEz!
Custom message
Chat Online 编辑模式下无法使用
Chat Online inputting...