Go Down

Topic: Arduino Pong on GLCD (Read 2807 times) previous topic - next topic

Jul 21, 2012, 07:22 pm Last Edit: Jul 21, 2012, 07:27 pm by Cobalt1911 Reason: 1
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 :)
If you have any question about the code, the wiring or anything else, just ask :)


Cool. I like games with Arduino.



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

Duane B

Read this
then watch this


Jul 24, 2012, 06:08 pm Last Edit: Oct 19, 2012, 07:09 am by warunasanjaya11 Reason: 1
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.


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


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


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




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

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.



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

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131