Go Down

Topic: 128 X 64 KS0108 (Read 911 times) previous topic - next topic

markavo

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: [Select]
#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



floresta

Try swapping your chip select connections.

Don

markavo

Don

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


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

bperrybap

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

Go Up