Monthly Archives: September 2013

Now It Plays the Tetris Theme Song!

Now it plays the Tetris theme song while you’re playing! An ATtiny85 is used to store the notes matrix and it listens to the ATmega328p on two pins to either play/stop the music or just pause it. I used the Arduino-Tiny core instead of the one from MIT HLT for the ATtiny85 since it supports the Tone() function in the Arduino library. It was actually quite hard to fit all the frequency values and duration values in a mere 512 bytes of RAM on the tiny85.

Here is a few more components that I’m considering to add to this Tetris game in the future:

-A 3-axis accelerometer (MMA8452Q) to provide another form of input;

-A LED bar graph, or just a couple LEDs, that could reflect the game progress/score.

-A separate small 8*8 or two 5*7 single colour LED matrices to display the next Tetris piece, and to allow the player to store the current piece.

2013-09-23 23.19.47


The Code:




Playing Tetris on My 16×8 LED Matrix

Since I’ve written a Tetris in Python half a year ago, It wasn’t that difficult for me to write this one for the Arduino. Other than the four arrow keys that are also used for the Snake game, another tact switch was added to immediately drop a piece to the bottom.

2013-09-22 16.53.13

The New Look of My Arduino Piano

Changes made in this version:

Changed to another brand of breadboard, so it’s much more compact.

Added black and white key caps to make it more intuitive to play.

Replaced the 3W speaker with a 1W one to make the piano more compact yet still keeping the sound relatively loud.

2013-09-21 22.17.25