Pages: [1]   Go Down
Author Topic: Connecting 128*64 LCD to Arduino Mega 2560 R3  (Read 684 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi All,

I am trying to use http://www.bajdi.com/wp-content/uploads/2013/03/glcd-128x64.jpg this LCD display with my Arduino Mega 2560 R3. I tried to use this library in my work http://playground.arduino.cc/Code/GLCDks0108. I have connected the LCD and Arduino as mentioned in IMPORTANT NOTE section of the above tutorial.

But when I tried to run this hello world program there. It shows a bright and dark dots all over the LCD. I tried different codes. But situation is the same. What has gone wrong in here?

/*
  GLCD Library - Hello World
 
 This sketch prints "Hello World!" to the LCD
 and shows the time in seconds since reset.
 
  The circuit:
  See the inlcuded documentation in glcd/doc directory for how to wire
  up the glcd module. glcd/doc/GLCDref.htm can be viewed in your browser
  by clicking on the file.
 
 */

// include the library header
#include <glcd.h>

// include the Fonts
#include <fonts/allFonts.h>

void setup() {
  // Initialize the GLCD
  GLCD.Init();

 // Select the font for the default text area
  GLCD.SelectFont(System5x7);

  GLCD.print("hello, world!");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  GLCD.CursorTo(0, 1);

  // print the number of seconds since reset:
  GLCD.print(millis()/1000);
}
Logged

Offline Offline
Sr. Member
****
Karma: 12
Posts: 380
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What is the make/model number of your LCD? (the photo has pinouts, but no model number).
Logged

Do not IM me. I will not respond. Ask questions in the forum.

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

It has a PSB pin, so it is a ST7920 based display.
The ST7920 controller is not supported by GLCDks0108 library.
You could use u8glib (http://code.google.com/p/u8glib/)

In the examples use "U8GLIB_ST7920_128X64_1X(sck, mosi, cs [, reset])"

Follow the instruction for this controller on this page http://code.google.com/p/u8glib/wiki/device (below the table)

Oliver
Logged

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

Thanks oilkarus your solution works fine!
Logged

Pages: [1]   Go Up
Jump to: