Arduino Pong on GLCD

Hi everyone, today I've finished a Pong-like "video-game" on Arduino. It uses an Arduino (Mega, Uno, Leonardo ...), a breadboard, jumpers, a press-button, two joysticks, a potentiometer and a GLCD based on a ST7920 controller. Everything is in the code, it's not really hard to understand.

Here are some pics :

Here we can barely see the ball but it's clearer in reality.

And the code (GPL License) :

Oh ! The code was initially written in french so there might be some english mistakes, sorry about that :slight_smile:
If you have any question about the code, the wiring or anything else, just ask :slight_smile:

Cool. I like games with Arduino.

Oliver

Really nice, why not mount in a nice enclosure and keep it

Duane B

rcarduino.blogspot.com

The KS0108 and SED1520 are widespread controller chips used in GLCD displays. Why did you use ST7920 controller?
Most GLCD panels require an external preset pot (variable resistor) to set the LCD working voltage (contrast) and may require a fixed resistor to limit the current in the back-light. Did you use an external preset pot and a fixed resistor?
These are some methods supported by GLCD library.

Init()

GLCD.Init() ; // initialize the library to draw dark pixels on a light background
GLCD.Init(NON-INVERTED) ; // same as above
GLCD.Init(INVERTED) ; // initialize the library to draw light pixels on a dark background

SetDisplayMode()

GLCD.SetDisplayMode(NON_INVERTED); // sets the state to normal
GLCD.SetDisplayMode(INVERTED); // sets the state to inverted

ClearScreen()

GLCD.ClearScreen(); // sets all pixels to WHITE (if NORMAL mode or BLACK if INVERTED)
GLCD.ClearScreen(WHITE); // same as above
GLCD.ClearScreen( BLACK); // clears screen writing BLACK pixels

ReadData()

GLCD.ReadData();

WriteData()

GLCD.WriteData( data);

Did you use those methods?

Payday loans
How to lose weight
How to lose weight fast
Mobile phone deals
Holiday insurance
Pet insurance
Apple
Microsoft
Paypal
Pinterest

Hi warunasanjaya,
Well first, if I used the ST7920 is simply because that's what I had ! And once you bought a GLCD you can't really change the controller ... Btw, I took this one because it's the cheapest I could find, about 12$ )
About the wiring, I used the 3.3v output pin for the backlight and the 5v output with a pot for the contrast.
Finally, I didn't use any of these methods as you could have read in the source code simply because I used the u8glib.

Cobalt1911

Very Cool! Another arduino pong project with full-spectrum color, using a TFT LCD Screen and the st7735 controoler is at: http://lucidtronix.com/tutorials/7