Introduction: Tetris Uno
This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (www.makecourse.com).
The following Instruct-able shows the design process for the Tetris Uno project.
Step 1: Frame Design
The frame of the Tetris game are comprised of three parts; the lid the, the box and the door. The box is simply the "black box" that comes standard with the Makecourse arduino kit. The dimensions of the Box are 7.62 X 4.62 X 2.25 in.Using a cutting tool two rectangles need to be cut out of the front and back of the box. One rectangle will be 2.57 x 1.77 in and will be used for the latch mechanism. The other hole will be 1 x 0.55 in at the back of the box, This square cut out will be where the power cable extends out of the box.
The next step of the frame design process is to 3-D print the mechanical parts. four parts of the project were 3-D printed; The door, The lid, and two links in the four bar mechanism used to control the door. The drawings for these parts can be found in the pictures above.The connection between the links can be seen above.
lastly you will need a drill in order to create hole so that a hinge can be attached for the latch and so that the lid can be attached to the box. (make sure to cut the pointy ends of the screws off so that they do not protrude from the box).
Step 2: The Electronics
Arduino Pin layout:
- pin 2: 1N1
- pin 3: 1N2
- pin 4: 1N3
- pin 5: 1N4
The green and orange wires are power and ground and go directly into the respective power and ground railings on the bread board. The pins are connected directly to the driver of the stepper motor as outlined above. The stepper motor controls the opening and closing of the latch once the user has lost the game.
- pin 6: connected in series to the down button
- pin 7: connected in series to the rotate button
- pin 8: connected in series to the left button
- pin 9: connected in series to the right button
the purple pin in the far right connects this series of pins to ground. The buttons allow the user to interact with the game changing the orientation, location and fall rate of the blocks
Bi-colored LED matrix:
- Pin 10: connected in parallel with the Load pin of the driver
- pin 11:connected in parallel with the Din pin of the driver
- pin 13: connected in parallel with the CLK pin of the driver
The LED bi-color matrix driver pins were connected in parallel to three 10k pull-down resistors as shown in the picture above. The function of the Drivers is to reduce the number of pins needed to operate the two LED matrices. The matrices themselves are where the tetris game is displayed
Step 3: The Code
The code above was used in order to control the LED matrices and stepper motors using the Arduino Uno. It was adapted from the code of Jae Yeong BaeUBC ECE jocker.tistory.com and Jollifactory .
Step 4: The Final Product
The video above shows a quick example of what the fully functioning device will look like.