Arduino color game (Bomber) using VGA library

Cool game Rob :)

I have done a “new” game:

Pong with colors and sound, running for a VGA monitor.

Link to the video here:

As for “Bomber”, this game does not need a special shield or support chips, but just few resistors, a DSUB15 connector, a pair of potenziometers and a buttons.

Since I am using only one potenziometer and button, the two paddles move in parallel. Anyway, the code is ready for the “second player”.

The code is at the bottom.

NB second version at #13

pong_VGAx.ino (16.6 KB)

complimenti. sicuramente cercherò di riprodurlo.

Grazie, fammi sapere come va. Se hai domande, chiedi pure!

Hi Smaffer,

it is really unbelievable what you have done with a bare Arduino, without the help of any other supporting chip!

When you will publish the first release of the game, I will be one of the first to download and try it.


Pong VGA with colors and for two players is ready!

The code has been updated for the latest VGAx library by Smaffer (August 2015) and overall optimized for two separated players. Many bugs have been fixed, expecially involving the restart of a new match.

In this video, I show the whole setup placed in two rock solid wood box. A bigger one for the Arduino board, the DSUB15 connector and the first player button and wheel; the second player paddle, containing only his button and wheel, is connected to the main one with a recycled USB cable and socket. In this way the main box can be used for my previous single player game (Arduino Bomber).

The code is at the bottom.


pong_VGAx_v1.1.ino (18.7 KB)

So fu*king cool will sure try it out!

As for "Arduino Bomber": I noticed this line in the code:

  Vaereo = 0.1 + random(20)/100;

Won't that always give you 0.1 ? (because random(20)/100 will always give you 0)

Ok rob_cai, COLOR PONG works! :D


Thanks for the code.

To odometer: yes, correct - in VGAX_Bomber_v02 - I modified it to:

Vaereo = random(200)/100.0 + 2 + 2*level;

and the plane speed is increased.

To Space_Invader: thank you for the comment. Are you using an home made Arduino? Cool!

JUNKHACK has reproduced a very cool PONG console using a real ping pong paddle to hold together the components and two white balls for the potentiometers, as shown here.

Well done Junkhack!


I tryed to upload the code on an Arduino NANO ATmega328 (as Junkhank did already), and it works!



Some of you may know that I love messing around with AVR's and Video

My latest challenge incorporates a ATMEGA8 at 16Mhz

I have made a simple PCB so that I can create 15bit colour (6R, 6B, 3G) in VGA 200 pixels wide for text display should give me about 33 5x7 characters across the screen

One section of the screen is text, the other will be graphics, I wont be using the ram as a screen map (well the mega8 only has 1k !) so all the graphics will be prepared line-by-line before it is drawn

I based some of my work on Smaffers original code, thanks for that Smaffer !!

Why not try it on a '1284P, 16K SRAM, lots more options.

CrossRoads: Why not try it on a '1284P, 16K SRAM, lots more options.

I have done quite a few video projects on the 1284, I love that thing ! I just like to try some trickier ideas now and again, trying to get blood out of a stone !

Another classic game is in progress...


...Arduino VGA snake

Hi, maybe someone can help me! I am using an Arduino Uno R3 and IDE 1.6.5 R5 for programming! The VGA-Output works, and also the Paddel-Controller are working.

When i am trying pong or bomber i can load it on my arduino with no Problems! But then my vga-monitor tells me there is no Signal!! I found out when i am commenting out the analogRead command then i get Video Output, but the paddels are not working!

void processInputs() { //wheelPosition = analogRead(WHEEL_PIN); buttonStatus = digitalRead(BUTTON_PIN) ; }

So it Looks like there is a problem between analoginputs and vga-output!

Dear Synd, I am using IDE 1.6.4

I just realized that in the wheel and button PIN definition it is written:

#define BUTTON_PIN A2 #define WHEEL_PIN 1

coud it be that it should be replaced with the following?

#define BUTTON_PIN A2 #define WHEEL_PIN A1

in my IDE version both sintax works... This is the simplest thing coming in my mind at the moment. If it does not work, could you try other pins, just to see what happens (not A0 which is used for sound!).

Hi, thanks for feedback! I made already a correction of the ports according to my connections. And i tested already in a seperate sketch the paddels. They are working. Its a strange behavior of the vga-output when the analogRead command is used in the sketch. Looks like there is somthing happening to the timing. When i comment out the two lines with the analogRead in your sketch, i get a vga-output. But when i remove the comment, then i got no signal on my monitor! I already tried ide 1.6.4, makes no difference. The digitalRead of the buttons work!

Do you have a signal on your monitor with this?

  • wheelPosition =* 1023*digitalRead(WHEEL_PIN);
  • buttonStatus = digitalRead(BUTTON_PIN) ;*

Which pin have you used for the paddles? Only A1 to A5 work of course. Are your paddles 10 kOhm potenziometers or similar?

Sorry, I do not have many other ideas...