Pages: [1]   Go Down
Author Topic: Arduino Pong on GLCD  (Read 2172 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley
If you have any question about the code, the wiring or anything else, just ask smiley
« Last Edit: July 21, 2012, 12:27:51 pm by Cobalt1911 » Logged

Germany
Offline Offline
Edison Member
*
Karma: 136
Posts: 1479
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Cool. I like games with Arduino.

Oliver
Logged

Dubai, UAE
Offline Offline
Edison Member
*
Karma: 22
Posts: 1675
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Duane B

rcarduino.blogspot.com
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


« Last Edit: October 19, 2012, 12:09:18 am by warunasanjaya11 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1]   Go Up
Jump to: