Pages: [1]   Go Down
Author Topic: 128 X 64 KS0108  (Read 894 times)
0 Members and 1 Guest are viewing this topic.
UK
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi All

First post for me..

Can any one help me out please i'm using the glcd library examples with a 128 x 64 GLCD display but when i echo text to the lcd the start of the lcd display (0,0) is the middle of the screen not the start of the screen

Any ideas why this would be please

The example code is :

Code:
#include <glcd.h>
#include "fonts/Arial14.h"         // proportional font
//#include "include/glcd_Deprecated.h"

/*
 * Check for small displays as this code was written
 * before small displays were supported.
 */


unsigned long startMillis;
unsigned int loops = 0;
unsigned int iter = 0;

void setup(){
  GLCD.Init(NON_INVERTED);   // initialise the library, non inverted writes pixels onto a clear screen
  GLCD.ClearScreen(); 
  GLCD.SelectFont(Arial14); // switch to fixed width system font
}


void  loop(){   // run over and over again
  //iter = 0;
  //startMillis = millis();
 
  // display number of iterations in one second
  //GLCD.ClearScreen();               // clear the screen 
  GLCD.CursorTo(-2,0);              // positon cursor 
  GLCD.Puts("Line 1");               // print a text string
  GLCD.CursorTo(-4,1);              // positon cursor
  GLCD.Puts("Line 2");           // print a number
  GLCD.CursorTo(0,2);              // positon cursor
  GLCD.Puts("Line 3");           // print a number
  GLCD.CursorTo(0,3);              // positon cursor
  GLCD.Puts("Line 4");           // print a number

Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 4389
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try swapping your chip select connections.

Don
Logged

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

Don

Thank you , so much ...so simple yet so frustrating ..


All sorted now thank to you help .....
Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 70
Posts: 2738
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just as a follow up, the v3 version of the library includes a diagnostic sketch
as well as some trouble shooting information that could help diagnosing this issue.
Take a look at the included HTML documentation.
See the "Troubleshooting" section.

One other thing with respect to your sample sketch.
I assume that sketch and the "odd" CursorTo() calls were just part of your testing.
However, keep in mind that negative values used for column will be passed as large positive values since the
column argument is an unsigned variable.
Since that large column value will be invalid,
I believe that it will cause the CursorTo() to be ignored.

--- bill
Logged

Pages: [1]   Go Up
Jump to: