VGA Tetris With Arduino Uno




I have reproduced a color version of the classical game TETRIS running for a VGA monitor, by means of a bare Arduino Uno and few other components.

The goal was to avoid any special shield or supporting IC. The only needed components are four buttons, few resistors and a DSUB15 connector.

I used Arduino IDE 1.6.4. and the VGAx library done by Smaffer and publish on GitHub here.

This library allows to use four color with a resolution of 120 x 60 pixels, not many but enough for this retro-game. I optimized the graphic for a 4:3 VGA monitor. The wide-screen is too deformed at the moment, but I plan to write a version where you can choose the monitor type.

More details can be found in this Arduino forum.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Schematic and Code

To reproduce this game you need first to download the code. Version with sound here.

Then you need the VGA libraries.

You can immediatly upload them on an Arduino Uno. Some warnings are "normal", for instance, my (Italian) version says:

Lo sketch usa 10.384 byte (32%) dello spazio disponibile per i programmi. Il massimo è 32.256 byte.
Le variabili globali usano 1.959 byte (95%) di memoria dinamica, lasciando altri 89 byte liberi per le variabili locali. Il massimo è 2.048 byte. Poca memoria disponibile, potrebbero presentarsi problemi di stabilità.

Do not warry if the global variables memory uses up to 95% of space. In my experience there are no stability problems.

If you don't get any other error message, you can build your own VGA shield.

Needed components:

  1. an Arduino Uno Rev 3 - original or a clone, but original is better :-)
  2. a DSUB15 connector (i.e. a standard 15 pin VGA one)
  3. resistors: 2 x 68 Ohm; 2 x 470 Ohm and 4 x about 1 to 2 kOhm
  4. four buttons
  5. facoltative: a matrix board or just some wire and pins
  6. facoltative: a speaker.

Connect the parts as shown in the upper schematic.The speaker must be connected to pin A0.

If you have done everything properly, you should be ready to play!


Step 2: Adding a Case With Buttons

Finally I have put the Arduino board and connections in a wood box. You can see an intermediate step with all the holes drilled in the box and the button inserted, and finally the outer and inner view.

The Arduino connections are exactly the ones shown in the first schematic.

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    10 Discussions


    2 years ago


    ist it possible to show the score with numbers?

    1 reply
    Rob CaiTonyv47

    Reply 2 years ago

    Yes sure, but i like the "score bar" concept. Each time it reaches the top the bar is reset to zero and the speed increases.


    2 years ago

    what kind of buttons are you using? normally open or normally closed

    1 reply
    Rob Caimquiring1

    Reply 3 years ago

    After a looong time, I have finally added the sound. Please find the latest version in the text above. The speaker has to be connected to the analog pin A0.

    Rob Caimquiring1

    Reply 3 years ago

    Thank you. You are right, no sound at the moment. I plan to add it in the next version.

    Rob Caijerrymonkey123

    Reply 3 years ago

    Yes I do, but I already had this wood box among my spare parts. Furthermore I need some space since the four buttons are quite long, as shown in the latest pictures. Anyway using smaller components (an Arduino Nano and flat buttons) anybody can shrink this toy a lot.


    3 years ago

    don't you think the wooden box is too big?