how to compile ks0108 library!!!!!!

hi everyone....this is my first post here. i have been searching for last 9 days for the answer, so please give me anything u have!

i have a 128X64 display, the model says its a GXM12864-06 ver2.0! dont know what company is it.....i live in china so possibly some local company. and possibly it has ks0108 or ks0107 chip in it. in the shop the seller ran it with a ks0107-08 controller ad it works fine and show chinese characters. now i hooked it up with arduino and all the pins are checked thousand times.....but there is no display! backlight is on. but no characters or anything.

its not my first time with lcds. i worked with 16X2 and another 128X64 (ST7920) and they work fine. the st7920 library works without any trouble but not very easy to work with

this ks0108 lib is good but i just dont know how to make a ks0108.o file. i tried to compile it with eclipse and netbeans and it gives a lot of errors. even with arduino compiler the ks0108.cpp file gives error.

there is no problem with the lcd. please dont ask me to check the connection or the pot.....they are all good. i dont have a .o file...i think thats where the problem is

can anyone please send me a whole zip file with the .o file in it? or tell me very detail instructions how to make one?

im stuck for over a week :'( and almost lost all hope.......please help :-[

you shouldnt have to make a .o file at all, if you put it into the library section of the arduino ide it should automatically compile. and do you have a potentiometer or some resistors to control your contrast? if the contrast is not set either everything will be black or there will be nothing.

:'( yes i do have a pot and i know about it >:( i just checked the st7920 codes and libs with this lcd and the other real st7920 lcd, doesnt work with this one. other one works fine(the pong game) :-[ trying ks0108 libs again

i dont see any ks0108.o file......but the wiki and everything says there should be a .o file somewhere

what the F is wrong? :'( is there anyone had the same problem? please help :'( :'( :'(

what version of the ide are you using?

arduino 0017 and ks0108 library first release and beta both tried. and a few other modified ones. no good

anything wrong with it? :-/

can you tell us exactly how you tried to put in the library? im using ver 17 also, and this is how my file structure looks

C:\Documents and Settings\andres\Desktop\arduino\arduino-0017\arduino-0017\hardware\libraries\ks0108

the ks0108 folder has all the little bits that make up the library. make sure the actual files are there, and not another folder that then has the files, i've done that so many times its not even funny.


there are 9 files in the ks0108 folder ks0108.cpp ks0108.h ks0108_Mega.h ks0108_Sanguino.h Arial14.h (i think its the font file) ks0108_Arduino.h ks0108_Panel.h SystemFont5x7.h TestPattern.h ( dont know where did i get it, but its fine :-X)

and also a folder in it named "examples" where the GLCDexample.pde file stays with readme.txt and keywords.txt

should i cry? >:( and smash the LCD??

well, can you post your code that you’re using?

i havent written any code, using the default GLCD example which came with it…hope there is nothing wrong in there :o


  • GLCDexample
  • Basic test code for the Arduino KS0108 GLCD library.
  • This code exercises a range of graphic functions supported
  • by the library and is an example of its use.
  • It also gives an indication of performance, showing the
  • number of frames drawn per second.

#include <ks0108.h>
#include <Arial14.h> // font definitions
#include <SystemFont5x7.h>

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
introScreen(); // show some intro stuff

void introScreen(){
GLCD.SelectFont(Arial_14); // you can also make your own fonts, see playground for details
GLCD.GotoXY(20, 2);
GLCD.Puts(“GLCD version 1.1”);
GLCD.DrawRoundRect(16,0,99,18, 5, BLACK); // rounded rectangle around text area

GLCD.SelectFont(System5x7); // switch to fixed width system font

for(byte count=9; count >0; count–){ // do countdown
GLCD.CursorTo(0,1); // first column, seconds row (offset is from 0)
GLCD.PutChar(count + ‘0’);

void showCharacters(){
byte line = 3; // start on the fourth line
for(byte c = 32; c <=127; c++){
if( (c-32) % 20 == 0)
GLCD.CursorTo(1,line++); // CursorTo is used for fixed width system font

void drawSpinner(byte pos, byte x, byte y) {
// this draws an object that appears to spin
switch(pos % 8) {
case 0 : GLCD.DrawLine( x, y-8, x, y+8, BLACK); break;
case 1 : GLCD.DrawLine( x+3, y-7, x-3, y+7, BLACK); break;
case 2 : GLCD.DrawLine( x+6, y-6, x-6, y+6, BLACK); break;
case 3 : GLCD.DrawLine( x+7, y-3, x-7, y+3, BLACK); break;
case 4 : GLCD.DrawLine( x+8, y, x-8, y, BLACK); break;
case 5 : GLCD.DrawLine( x+7, y+3, x-7, y-3, BLACK); break;
case 6 : GLCD.DrawLine( x+6, y+6, x-6, y-6, BLACK); break;
case 7 : GLCD.DrawLine( x+3, y+7, x-3, y-7, BLACK); break;

void loop(){ // run over and over again
iter = 0;
startMillis = millis();
while( millis() - startMillis < 1000){ // loop for one second
GLCD.DrawRect(0, 0, 64, 61, BLACK); // rectangle in left side of screen
GLCD.DrawRoundRect(68, 0, 58, 61, 5, BLACK); // rounded rectangle around text area
for(int i=0; i < 62; i += 4)
GLCD.DrawLine(1,1,63,i, BLACK); // draw lines from upper left down right side of rectangle
GLCD.DrawCircle(32,31,30,BLACK); // draw circle centered in the left side of screen
GLCD.FillRect(92,40,16,16, WHITE); // clear previous spinner position
drawSpinner(loops++,100,48); // draw new spinner position
//GLCD.FillRect(24,txtLINE3,14,14, WHITE); // clear text area that will be drawn below
GLCD.CursorTo(5,5); // locate curser for printing text
GLCD.PrintNumber(++iter); // print current iteration at the current cursor position
// display number of iterations in one second
GLCD.ClearScreen(); // clear the screen
GLCD.CursorTo(14,2); // positon cursor
GLCD.Puts("FPS= "); // print a text string
GLCD.PrintNumber(iter); // print a number

well…maybe you should check your wiring for the 1001th time… you cant really say there isn’t absolutely a problem there if the screen isn’t working. i have a screen that seems pretty much exactly the same
and i’ve had some great success hooking it up to a duemilanove. and if you’re really sure then i guess we can keep brainstorming and track down this problem!

i will be back tomorrow with every single motherfucking pin checked…gonna get my bike from the school now. actually im making a digital gauge for my honda vfr400 nc30 bike ::slight_smile:

thanks a lot for ur replies…please keep it up :slight_smile:

neat, i made a tachometer and voltage meter for my car, it also controlls some ground effects lights. it was a pretty fun project, i hope you get yours working