Introduction: Arduino VGA Games 4-in-1

Picture of Arduino VGA Games 4-in-1

After the publication of the Arduino VGAx library on GitHub done by Sandro Maffiodo aka Smaffer, I have reproduced and published on Instructable some of the most famous classical games. Recently I decided to put four of them together, in particular: Pong, Breakout, Bomber and a drawing toy inspired to Etch-a-Sketch.

The hardware is simply the same of my first Instructables: VGA Pong with Arduino Uno.

The only needed components are two potentiometers, two buttons, few resistors and a DSUB15 (VGA) connector. As usual, no supporting IC or special shields!

You can see the 4-in-1 games in action in this video.

The VGAx library allows to use four color with a resolution of 120 x 60 pixels, not many but enough for this retro-game “console”. The graphic is raw but, thanks to the use of the potentiometers, the games run smoothly. Simple sound effects are available too.

Step 1: How to Build Your Own "4-in-1 Games" With Arduino

Picture of How to Build Your Own "4-in-1 Games" With Arduino

First download " ArduinoVGAgames" code at the bottom of this page and copy it on your PC in a directory with the same name. Then download the Smaffer’s VGAx libraries from this link on GitHub. The easiest way is to copy them in the Arduino software subfolder named "libraries", to be immediately recognized.

Uploaded then the code in your Arduino (I tested Uno and Nano). A worning for low available memory is normal. If you do not have other errors everything is ok and you can immediately start to build your own console.

For this you need:

  • an Arduino Uno Rev. 3 or an Arduino Nano 3.x
  • a DSUB15 Connector, i.e. a VGA female connector or a VGA cable to be cut
  • four resistors: 2 x 68 Ohm and 2 x 470 Ohm
  • two 10 kOhm linear potentiometers (similar values are fine too)
  • two buttons other two resistors (from 1 to 2 kOhm are fine)
  • some piece of cable + breadboard or a strip board
  • facultative: a piezo speaker

The schematic is reported at the beginning of this Instructable, together with an overview of the finished “console”. The speaker must be connected to analog pin A0.

I placed the Arduino board with the VGA connector in a wood box, which holds also the second player potentiometer and button, while the main player potentiometer and button are in a separate and smaller box.

If you decide to reproduce this toy, I appreciate if you write a comment or send a picture in the comment section below.

Step 2: Some Final Comment

Joining four games in one was challenging, due to the Arduino lack of SRAM, the real bottle-neck of the VGA performances.

The AVR microcontroller has only 2048 bytes available to store and manipulate the variables. On the other hand the VGAx library stores the screen variables in a 120x60 pixels framebuffer where each pixel needs 2 bits (4 colors), for a total of 1800 bytes.

Only 248 bytes are then available for the sketch variables but, in my experience, one should leave at least 100 bytes free to avoid instabilities.

The VGA standard has been officially put in retirement in 2015, for being substituted with HDMI, and nowadays is almost impossible to find a new monitor or TV that implements it.

The question is then: does it make sense to produce an Arduino game for this standard? Well, I believe the answer is yes! For this reason, nowadays, almost everybody has an old and unused VGA monitor, eventually 4:3, still working fine, since it has been replaced with an HD one. If you, as I do, feel sorry to throw in the waste a working yet obsolete device, you can convert it in an old style retro-gaming station by means of a bare Arduino and few other components.

Comments

do_morro (author)2017-05-13

Can I change some game to Tetris?

Rob Cai (author)do_morro2017-05-16

Yes sure! I did a newer instructable to do that! see here.

vadym6 (author)Rob Cai2017-06-04

link isnt clickable

Rob Cai (author)vadym62017-06-05

Tetris is here.

Now it should work.

DIY Circuits (author)2017-03-04

What about composite 4-in-1 ? Would that be also possible?

Rob Cai (author)DIY Circuits2017-03-15

Do you mean "composite video"? In my understanding having a composite color video output (RGB) for the Arduino exceeds its capabilities.

chanov (author)Rob Cai2017-03-16

What about TVOut version, possible?

Rob Cai (author)chanov2017-03-28

Yep! See my reply above, to DYI Circuits

DIY Circuits (author)Rob Cai2017-03-28

Yes, I meant composite video, but I don't think that RGB is necessary just black and white composite video, there should be even a library for that.

Rob Cai (author)DIY Circuits2017-03-28

Ok, then for B&W you can use the TVout library. My games can be converted for that but the conversion is not straight forward, many commands have a slighly different sintax. I did it (for instance) for tetris. You can find both versions here, among my other instructables.

fredlb (author)2017-03-13

Hi,

I want try do this project , it's amazing !

But the problem my screen is completely disformed like you can see on the picture above.

I try another monitor and another power but the problem was the same

Perhaps it's because i'm working for the moment with a breadbord ?

Thanks for you attention :-)

fredlb (author)fredlb2017-03-14

Finally

i find myself the solution of my problem ...

I change my version of Arduino , i try the version of this instructable (1.6.4) and it's working fine !

Perhaps a picture of my versio coming soon ...

Rob Cai (author)fredlb2017-03-15

dear fredlb,

for my curiosity, which version where you using before?

A picture will be very appreciated!

fredlb (author)Rob Cai2017-03-16

Hello ,

I use the latest version of Arduino 1.8.1 and i try also an old version like 1.5 , but only the 1.6.4 version works .

For the picture , are you talking about the problem ?

Rob Cai (author)fredlb2017-03-18

Dear fredlb, thank you for the comment, I did not realize before that the latest Arduino software version (IDE 1.8.1) is not compatible.

About the picture, if you decide to build a game consolle, such as the one below, if you like you can show it here with a picture.

PiotrS (author)2016-12-29

This is amazing i can show my daughter how it was done in my ages :)

About This Instructable

2,217views

26favorites

License:

More by Rob Cai:Arduino VGA Console With Five GamesSimple Grafting Without Special ToolsArduino VGA Game Console
Add instructable to: