Go Down

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

Cobalt1911

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) :
http://pastebin.com/XT7nMdRU

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 :)

olikraus

Cool. I like games with Arduino.

Oliver

DuaneB

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

Duane B

rcarduino.blogspot.com
Read this
http://rcarduino.blogspot.com/2012/04/servo-problems-with-arduino-part-1.html
then watch this
http://rcarduino.blogspot.com/2012/04/servo-problems-part-2-demonstration.html

Rcarduino.blogspot.com

warunasanjaya11

#3
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.



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



Cobalt1911

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

samwell

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