Hello to all,
thanks to the VGAx library done by Smaffer, based on the previous work done by Nick Gammon, I have done a little color game for an Arduino Uno working for a VGA monitor. See for details here:
The target was to use an Arduino Uno board without special shields and supporting IC.
the fundamental components are a button, a potenziometer, few resistors and DSUB15 connector.
For the VGA library, the DSUB15 connections, and for the color choice, please refer to smaffer post:
The potenziometer should be connected to analogue pin 2 (A2), the button to analogue pin 1 (A1) and the buzzer to A0.
The code is attached here.
Enjoy!
NB an update of the game (version 02) is available in this post at #6
Good question! And thank you for the positive comment!
This is an "inheritance" of a previous code, i.e. Arduino Bomber B&W with TVout library that I did before the VGA version (see here).
I had problem in the past with the digitalRead command (sorry, I forgot the details).
By the way, later on I trasform the "analog" read of the button in a 0 - 1 form with the following part:
The analog pins can be used identically to the digital pins, using the aliases A0 (for analog input 0), A1, etc. For example, the code would look like this to set analog pin 0 to an output, and to set it HIGH:
It uses the recent "VGAXUtils.h" written by Smaffer, to draw lines, circles, rectangles, and so on (see his post for details).
The code has needed deep modifications to be compatible with these functions, but the screen is now drawn roughly ten times faster and the game became more smooth and precise.
The code is attached here.
As said before: enjoy!
P.S. the second file (bomber_alpha.ino) is the "old" version for TVout libraries
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 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).
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.
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 !!