KS0108

This driver has been tested on a GDM12864H from Sparkfun Electronics.

Font functions

#include "mbed.h"
#include "KS0108.h"  


#include "Arial12.h"
#include "Arial14.h"
#include "Comic24.h"
#include "vivaldi16.h"


KS0108  display(p13,p12, p14, p11, p21, p22, p30, p29, p28, p27, p26, p25, p24, p23); 

int main() {                            
    

    while(1) {

    display.ClearScreen();    

    display.GotoXY(5,0);           
    display.SelectFont(Arial12,BLACK,ReadData);
    display.PrintNumber(1);
    display.PrintChar('m');    
    
    display.GotoXY(5,16);
    display.PrintString("arial Font test");            
    wait(3);
    
    display.GotoXY(2,32);           
    display.SelectFont(vivaldi16,BLACK,ReadData);
    display.PrintString("Vivaldi font");    
    wait(3);
    }

}

Graphic functions

#include "mbed.h"
#include "KS0108.h"        
#include "image.h"
    
KS0108 display (p13,p12, p14, p11, p21, p22, p30, p29, p28, p27, p26, p25, p24, p23);                        
void testlib(int i);

int main() {

    display.ClearScreen();     
    display.RoundRectangle(0,0,127,63,3,BLACK);
    
    while(1){          
       
          display.HLine(20,70,30,BLACK);
          display.HLineShort(30,20,50,BLACK);
          display.VLine(20,40,30,BLACK);
          display.VLineShort(70,5,50,BLACK);
          display.SlantyLine(5,8,20,30,BLACK);
          display.DegreeLine(15,30,30,6,20,BLACK); 
          display.FullRectangle(10,30,15,34,BLACK);
          display.EmptyRectangle(5,5,50,59,BLACK);
          display.RoundRectangle(30,20,80,35,7,BLACK);    
          wait(2);
        display.ClearScreen();
       
    }

}

KS0108 library