KS0107 KS0108 library

General discussion on mikroC.
Post Reply
Author
Message
gjergji
Posts: 25
Joined: 27 Sep 2007 22:34
Location: Albania Tirana tek liqeni

KS0107 KS0108 library

#1 Post by gjergji » 25 Sep 2008 10:38

I have just written my own library. The reason i've written it myself is that i like to have my code under control and know exactly what it does, how it works and resources it uses, and it seems to be a bit faster than the library that comes with mikroC.
When writing a string you must choose the side (i made it this way because some people might like to split the display i two parts), you can call the function twice to write on both sides.
Some pieces of code where found elsewhere on the web (it is not everything mine).
I uses a new aproach in writing text as it uses a 2D array to strore the font.
Any question or modification to make it better is welcome.

Code: Select all

const unsigned short alfab[][5] = {
        {0x00,0x00,0x00,0x00,0x00}, //* Espace    
        {0x00,0x00,0x4f,0x00,0x00}, //* ! */
        {0x00,0x07,0x00,0x07,0x00}, //* " */
        {0x14,0x7f,0x14,0x7f,0x14}, //* # */
        {0x24,0x2a,0x7f,0x2a,0x12}, //* $ */
        {0x23,0x13,0x08,0x64,0x62}, //* % */
        {0x36,0x49,0x55,0x22,0x20}, //* & */
        {0x00,0x05,0x03,0x00,0x00}, //* ' */
        {0x00,0x1c,0x22,0x41,0x00}, //* ( */
        {0x00,0x41,0x22,0x1c,0x00}, //* ) */
        {0x14,0x08,0x3e,0x08,0x14}, //* * */
        {0x08,0x08,0x3e,0x08,0x08}, //* + */
        {0x50,0x30,0x00,0x00,0x00}, //* }, */
        {0x08,0x08,0x08,0x08,0x08}, //* - */
        {0x00,0x60,0x60,0x00,0x00}, //* . */
        {0x20,0x10,0x08,0x04,0x02}, //* / */
        {0x3e,0x51,0x49,0x45,0x3e}, //* 0       
        {0x00,0x42,0x7f,0x40,0x00}, //* 1 */
        {0x42,0x61,0x51,0x49,0x46}, //* 2 */
        {0x21,0x41,0x45,0x4b,0x31}, //* 3 */
        {0x18,0x14,0x12,0x7f,0x10}, //* 4 */
        {0x27,0x45,0x45,0x45,0x39}, //* 5 */
        {0x3c,0x4a,0x49,0x49,0x30}, //* 6 */
        {0x01,0x71,0x09,0x05,0x03}, //* 7 */
        {0x36,0x49,0x49,0x49,0x36}, //* 8 */
        {0x06,0x49,0x49,0x29,0x1e}, //* 9 */
        {0x00,0x36,0x36,0x00,0x00}, //* : */
        {0x00,0x56,0x36,0x00,0x00}, //* ; */
        {0x08,0x14,0x22,0x41,0x00}, //* < */
        {0x14,0x14,0x14,0x14,0x14}, //* = */
        {0x00,0x41,0x22,0x14,0x08}, //* > */
        {0x02,0x01,0x51,0x09,0x06}, //* ? */
        {0x3e,0x41,0x5d,0x55,0x1e}, //* @          
        {0x7e,0x11,0x11,0x11,0x7e}, //* A */
        {0x7f,0x49,0x49,0x49,0x36}, //* B */
        {0x3e,0x41,0x41,0x41,0x22}, //* C */
        {0x7f,0x41,0x41,0x22,0x1c}, //* D */
        {0x7f,0x49,0x49,0x49,0x41}, //* E */
        {0x7f,0x09,0x09,0x09,0x01}, //* F */
        {0x3e,0x41,0x49,0x49,0x7a}, //* G */
        {0x7f,0x08,0x08,0x08,0x7f}, //* H */
        {0x00,0x41,0x7f,0x41,0x00}, //* I */
        {0x20,0x40,0x41,0x3f,0x01}, //* J */
        {0x7f,0x08,0x14,0x22,0x41}, //* K */
        {0x7f,0x40,0x40,0x40,0x40}, //* L */
        {0x7f,0x02,0x0c,0x02,0x7f}, //* M */
        {0x7f,0x04,0x08,0x10,0x7f}, //* N */
        {0x3e,0x41,0x41,0x41,0x3e}, //* O */
        {0x7f,0x09,0x09,0x09,0x06}, //* P         
        {0x3e,0x41,0x51,0x21,0x5e}, //* Q */
        {0x7f,0x09,0x19,0x29,0x46}, //* R */
        {0x26,0x49,0x49,0x49,0x32}, //* S */
        {0x01,0x01,0x7f,0x01,0x01}, //* T */
        {0x3f,0x40,0x40,0x40,0x3f}, //* U */
        {0x1f,0x20,0x40,0x20,0x1f}, //* V */
        {0x3f,0x40,0x38,0x40,0x3f}, //* W */
        {0x63,0x14,0x08,0x14,0x63}, //* X */
        {0x07,0x08,0x70,0x08,0x07}, //* Y */
        {0x61,0x51,0x49,0x45,0x43}, //* Z */
        {0x00,0x7f,0x41,0x41,0x00}, //* [ */
        {0x02,0x04,0x08,0x10,0x20}, //* \ */
        {0x00,0x41,0x41,0x7f,0x00}, //* ] */
        {0x04,0x02,0x01,0x02,0x04}, //* ^ */
        {0x40,0x40,0x40,0x40,0x40}, //* _ */
        {0x00,0x00,0x03,0x05,0x00}, //* `         
        {0x20,0x54,0x54,0x54,0x78}, //* a */
        {0x7F,0x44,0x44,0x44,0x38}, //* b */
        {0x38,0x44,0x44,0x44,0x44}, //* c */
        {0x38,0x44,0x44,0x44,0x7f}, //* d */
        {0x38,0x54,0x54,0x54,0x18}, //* e */
        {0x04,0x04,0x7e,0x05,0x05}, //* f */
        {0x08,0x54,0x54,0x54,0x3c}, //* g */
        {0x7f,0x08,0x04,0x04,0x78}, //* h */
        {0x00,0x44,0x7d,0x40,0x00}, //* i */
        {0x20,0x40,0x44,0x3d,0x00}, //* j */
        {0x7f,0x10,0x28,0x44,0x00}, //* k */
        {0x00,0x41,0x7f,0x40,0x00}, //* l */
        {0x7c,0x04,0x7c,0x04,0x78}, //* m */
        {0x7c,0x08,0x04,0x04,0x78}, //* n */
        {0x38,0x44,0x44,0x44,0x38}, //* o */
        {0x7c,0x14,0x14,0x14,0x08}, //* p         
        {0x08,0x14,0x14,0x14,0x7c}, //* q */
        {0x7c,0x08,0x04,0x04,0x00}, //* r */
        {0x48,0x54,0x54,0x54,0x24}, //* s */
        {0x04,0x04,0x3f,0x44,0x44}, //* t */
        {0x3c,0x40,0x40,0x20,0x7c}, //* u */
        {0x1c,0x20,0x40,0x20,0x1c}, //* v */
        {0x3c,0x40,0x30,0x40,0x3c}, //* w */
        {0x44,0x28,0x10,0x28,0x44}, //* x */
        {0x0c,0x50,0x50,0x50,0x3c}, //* y */
        {0x44,0x64,0x54,0x4c,0x44}, //* z */
        {0x08,0x36,0x41,0x41,0x00}, //* { */
        {0x00,0x00,0x77,0x00,0x00}, //* | */
        {0x00,0x41,0x41,0x36,0x08}, //* } */
        {0x08,0x08,0x2a,0x1c,0x08}, //* <- */           126
        {0x08,0x1c,0x2a,0x08,0x08}, //* -> */          127
        {0x14,0x3E,0x55,0x55,0x41},  //euro sign       128
        {0x68,0x5C,0x4B,0x49,0x01},//GBP sign         129
        {0x01,0x0A,0x7C,0x0A,0x01}//yen sign         130
        };



#define LCD_TRIS TRISD
#define LCD_DATA PORTD
#define ENABLE PORTB.F4
#define RW PORTB.F3
#define DI PORTB.F2
#define RESET PORTB.F5
#define CS1 PORTB.F0
#define CS2 PORTB.F1
#define LEFT  1
#define RIGHT 0
#define gjeresia_1_karakter 5
#define ON 1
#define OFF 0


void glcd_setside(unsigned char sides);
void _lcd_enable(void);
void glcd_setpage(unsigned char page);
void glcd_setxaddr(unsigned char y);
void glcd_write (unsigned char data);
void glcd_command(char command,char side1);
void glcd_start(char mode);
void glcd_mbush(char side, unsigned char fill);
void glcd_putch(char ch,char side,char start,char page);
void glcd_puts( char *uau,char side1,char start1,char page1);

//Inicializon GLCD
void glcd_start(char mode)
{
                                               
   RESET=0;
   Delay_us(5);
   RESET=1;
   Delay_us(5);
   
   glcd_command(0xC0, LEFT);           
   glcd_command(0xC0, RIGHT);              
   glcd_command(0x40, LEFT);                 
   glcd_command(0x40, RIGHT);
   glcd_command(0xB8, LEFT);                 
   glcd_command(0xB8, RIGHT);
   if(mode == ON)
   {
      glcd_command(0x3F, LEFT);              
      glcd_command(0x3F, RIGHT);
   }
   else
   {
      glcd_command(0x3E, LEFT);              
      glcd_command(0x3E, RIGHT);
   }

}


//Dergon komande ne GLCD
void glcd_command(char command,char side1)
{
  DI=0;
  RW=0;
  glcd_setside(side1);
  LCD_DATA = command;
  _lcd_enable();
}

//Dergon byte(data) tek GLCD
void glcd_write (unsigned char data)
{
  DI=1;
  RW=0;
  LCD_DATA = data;
  _lcd_enable();
}

//Zgjedh nje nga rreshtat per te shkruar nga 0 ne 7
void glcd_setpage(unsigned char page)
{
  DI=0;
  RW=0;
  PORTD = 0b10111000 | page;
  _lcd_enable();
}

//Clock byte in
void _lcd_enable(void)
{
  Delay_us(1);
  ENABLE=1;
  Delay_us(1);
  ENABLE=0;
}


//Zgjedh nje nga anet e GLCD, LEFT ose RIGHT
void glcd_setside(unsigned char sides)
{
  if (sides)                 // set a CS pin low to enable it
  {
    CS1 = 0;
    CS2 = 1;
  }
  else
  {
    CS1 = 1;
    CS2 = 0;
  }
}

//Zgjedh fillimin e germes. Percakton largesen e fillimit te germes nga ana e GLCD nga 0 ne 63
void glcd_setxaddr(unsigned char y)
{
  DI=0;
  RW=0;
  LCD_DATA = 0b01000000 | (y & 0b00111111);
  _lcd_enable();
}

//Mbush GLCD sipas nje byte te caktuar. Nese do te boshatisesh GLCD byte=0x00
void glcd_mbush(char side, unsigned char fill)
{
  unsigned char x,y;
  if(side)
  {
      glcd_setside(LEFT);
      for (x=0; x<8; x++)
      {
        glcd_setpage(x);                // set the page (x)
        glcd_setxaddr(0);               // set the y address to 0
        RW=0;
        DI=1;                          // setup for data
        LCD_DATA=fill;
        for (y=0; y<64; y++)           // clear the row
        {
          _lcd_enable();
        }
      }
   }
   else
   {
      glcd_setside(RIGHT);
      for (x=0; x<8; x++)
      {
        glcd_setpage(x);                // set the page (x)
        glcd_setxaddr(0);               // set the y address to 0
        RW=0;
        DI=1;                          // setup for data
        LCD_DATA=fill;
        for (y=0; y<64; y++)           // clear the row
        {
          _lcd_enable();
        }
      }
   }
}



//Paraqet nje germe nje GLCD
void glcd_putch(char ch1,char side1,char start1,char page1)
{
  char e;
  glcd_setside(side1);
  glcd_setpage(page1);
  glcd_setxaddr(start1);
  for(e=0;e<5;e++)
    {
      glcd_write(alfab[ch1-32][e]);
    }
  glcd_write(0);
}

//Paraqet nje string ne GLCD
void glcd_puts( char *uau,char side1,char start1,char page1)
{
char e=0,*addr=uau;
glcd_setside(side1);
glcd_setxaddr(start1);
glcd_setpage(page1);
  while(*uau)
  {
    for(e=0;e<5;e++)
    {
      glcd_write(alfab[*uau-32][e]);
    }
    *uau++;
    glcd_write(0);
  }
}
Learning...Learning...still Learning

dronology
Posts: 106
Joined: 29 Dec 2007 23:48
Location: istanbul
Contact:

#2 Post by dronology » 25 Sep 2008 14:51

It's very good but what does "Paraqet nje germe nje GLCD" and (similar sentences) mean? I think that they are comments and written in yor native language. Could you re-write them in english?
R. Giskard Reventlov & R. Daneel Olivaw

http://www.circuitechs.com
http://www.dronology.com

pwdixon
Posts: 1431
Joined: 13 Apr 2005 11:14
Location: UK

#3 Post by pwdixon » 25 Sep 2008 16:09

I ran Google translate against some of the text and it appears to be Slovenian but as some of the words didn't translate well I still can't tell what was being said.

gjergji
Posts: 25
Joined: 27 Sep 2007 22:34
Location: Albania Tirana tek liqeni

#4 Post by gjergji » 25 Sep 2008 17:39

The comments are in Albanian.

Code with comments in English.

Code: Select all

const unsigned short alfab[][5] = { //alfab or font
        {0x00,0x00,0x00,0x00,0x00}, //* Espace   
        {0x00,0x00,0x4f,0x00,0x00}, //* ! */
        {0x00,0x07,0x00,0x07,0x00}, //* " */
        {0x14,0x7f,0x14,0x7f,0x14}, //* # */
        {0x24,0x2a,0x7f,0x2a,0x12}, //* $ */
        {0x23,0x13,0x08,0x64,0x62}, //* % */
        {0x36,0x49,0x55,0x22,0x20}, //* & */
        {0x00,0x05,0x03,0x00,0x00}, //* ' */
        {0x00,0x1c,0x22,0x41,0x00}, //* ( */
        {0x00,0x41,0x22,0x1c,0x00}, //* ) */
        {0x14,0x08,0x3e,0x08,0x14}, //* * */
        {0x08,0x08,0x3e,0x08,0x08}, //* + */
        {0x50,0x30,0x00,0x00,0x00}, //* }, */
        {0x08,0x08,0x08,0x08,0x08}, //* - */
        {0x00,0x60,0x60,0x00,0x00}, //* . */
        {0x20,0x10,0x08,0x04,0x02}, //* / */
        {0x3e,0x51,0x49,0x45,0x3e}, //* 0       
        {0x00,0x42,0x7f,0x40,0x00}, //* 1 */
        {0x42,0x61,0x51,0x49,0x46}, //* 2 */
        {0x21,0x41,0x45,0x4b,0x31}, //* 3 */
        {0x18,0x14,0x12,0x7f,0x10}, //* 4 */
        {0x27,0x45,0x45,0x45,0x39}, //* 5 */
        {0x3c,0x4a,0x49,0x49,0x30}, //* 6 */
        {0x01,0x71,0x09,0x05,0x03}, //* 7 */
        {0x36,0x49,0x49,0x49,0x36}, //* 8 */
        {0x06,0x49,0x49,0x29,0x1e}, //* 9 */
        {0x00,0x36,0x36,0x00,0x00}, //* : */
        {0x00,0x56,0x36,0x00,0x00}, //* ; */
        {0x08,0x14,0x22,0x41,0x00}, //* < */
        {0x14,0x14,0x14,0x14,0x14}, //* = */
        {0x00,0x41,0x22,0x14,0x08}, //* > */
        {0x02,0x01,0x51,0x09,0x06}, //* ? */
        {0x3e,0x41,0x5d,0x55,0x1e}, //* @         
        {0x7e,0x11,0x11,0x11,0x7e}, //* A */
        {0x7f,0x49,0x49,0x49,0x36}, //* B */
        {0x3e,0x41,0x41,0x41,0x22}, //* C */
        {0x7f,0x41,0x41,0x22,0x1c}, //* D */
        {0x7f,0x49,0x49,0x49,0x41}, //* E */
        {0x7f,0x09,0x09,0x09,0x01}, //* F */
        {0x3e,0x41,0x49,0x49,0x7a}, //* G */
        {0x7f,0x08,0x08,0x08,0x7f}, //* H */
        {0x00,0x41,0x7f,0x41,0x00}, //* I */
        {0x20,0x40,0x41,0x3f,0x01}, //* J */
        {0x7f,0x08,0x14,0x22,0x41}, //* K */
        {0x7f,0x40,0x40,0x40,0x40}, //* L */
        {0x7f,0x02,0x0c,0x02,0x7f}, //* M */
        {0x7f,0x04,0x08,0x10,0x7f}, //* N */
        {0x3e,0x41,0x41,0x41,0x3e}, //* O */
        {0x7f,0x09,0x09,0x09,0x06}, //* P         
        {0x3e,0x41,0x51,0x21,0x5e}, //* Q */
        {0x7f,0x09,0x19,0x29,0x46}, //* R */
        {0x26,0x49,0x49,0x49,0x32}, //* S */
        {0x01,0x01,0x7f,0x01,0x01}, //* T */
        {0x3f,0x40,0x40,0x40,0x3f}, //* U */
        {0x1f,0x20,0x40,0x20,0x1f}, //* V */
        {0x3f,0x40,0x38,0x40,0x3f}, //* W */
        {0x63,0x14,0x08,0x14,0x63}, //* X */
        {0x07,0x08,0x70,0x08,0x07}, //* Y */
        {0x61,0x51,0x49,0x45,0x43}, //* Z */
        {0x00,0x7f,0x41,0x41,0x00}, //* [ */
        {0x02,0x04,0x08,0x10,0x20}, //* \ */
        {0x00,0x41,0x41,0x7f,0x00}, //* ] */
        {0x04,0x02,0x01,0x02,0x04}, //* ^ */
        {0x40,0x40,0x40,0x40,0x40}, //* _ */
        {0x00,0x00,0x03,0x05,0x00}, //* `         
        {0x20,0x54,0x54,0x54,0x78}, //* a */
        {0x7F,0x44,0x44,0x44,0x38}, //* b */
        {0x38,0x44,0x44,0x44,0x44}, //* c */
        {0x38,0x44,0x44,0x44,0x7f}, //* d */
        {0x38,0x54,0x54,0x54,0x18}, //* e */
        {0x04,0x04,0x7e,0x05,0x05}, //* f */
        {0x08,0x54,0x54,0x54,0x3c}, //* g */
        {0x7f,0x08,0x04,0x04,0x78}, //* h */
        {0x00,0x44,0x7d,0x40,0x00}, //* i */
        {0x20,0x40,0x44,0x3d,0x00}, //* j */
        {0x7f,0x10,0x28,0x44,0x00}, //* k */
        {0x00,0x41,0x7f,0x40,0x00}, //* l */
        {0x7c,0x04,0x7c,0x04,0x78}, //* m */
        {0x7c,0x08,0x04,0x04,0x78}, //* n */
        {0x38,0x44,0x44,0x44,0x38}, //* o */
        {0x7c,0x14,0x14,0x14,0x08}, //* p         
        {0x08,0x14,0x14,0x14,0x7c}, //* q */
        {0x7c,0x08,0x04,0x04,0x00}, //* r */
        {0x48,0x54,0x54,0x54,0x24}, //* s */
        {0x04,0x04,0x3f,0x44,0x44}, //* t */
        {0x3c,0x40,0x40,0x20,0x7c}, //* u */
        {0x1c,0x20,0x40,0x20,0x1c}, //* v */
        {0x3c,0x40,0x30,0x40,0x3c}, //* w */
        {0x44,0x28,0x10,0x28,0x44}, //* x */
        {0x0c,0x50,0x50,0x50,0x3c}, //* y */
        {0x44,0x64,0x54,0x4c,0x44}, //* z */
        {0x08,0x36,0x41,0x41,0x00}, //* { */
        {0x00,0x00,0x77,0x00,0x00}, //* | */
        {0x00,0x41,0x41,0x36,0x08}, //* } */
        {0x08,0x08,0x2a,0x1c,0x08}, //* <- */           126
        {0x08,0x1c,0x2a,0x08,0x08}, //* -> */          127
        {0x14,0x3E,0x55,0x55,0x41},  //euro sign       128
        {0x68,0x5C,0x4B,0x49,0x01},//GBP sign         129
        {0x01,0x0A,0x7C,0x0A,0x01}//yen sign         130
        };



#define LCD_TRIS TRISD
#define LCD_DATA PORTD
#define ENABLE PORTB.F4
#define RW PORTB.F3
#define DI PORTB.F2
#define RESET PORTB.F5
#define CS1 PORTB.F0
#define CS2 PORTB.F1
#define LEFT  1
#define RIGHT 0
#define gjeresia_1_karakter 5   // 1 caracter width. in this font it is 5
#define ON 1
#define OFF 0


void glcd_setside(unsigned char sides);
void _lcd_enable(void);
void glcd_setpage(unsigned char page);
void glcd_setxaddr(unsigned char y);
void glcd_write (unsigned char data);
void glcd_command(char command,char side1);
void glcd_start(char mode);
void glcd_mbush(char side, unsigned char fill);  //mbush=fill
void glcd_putch(char ch,char side,char start,char page);
void glcd_puts( char *uau,char side1,char start1,char page1);

//Inicializon GLCD=initialise GLCD
void glcd_start(char mode)
{
                                               
   RESET=0;
   Delay_us(5);
   RESET=1;
   Delay_us(5);
   
   glcd_command(0xC0, LEFT);           
   glcd_command(0xC0, RIGHT);             
   glcd_command(0x40, LEFT);                 
   glcd_command(0x40, RIGHT);
   glcd_command(0xB8, LEFT);                 
   glcd_command(0xB8, RIGHT);
   if(mode == ON)
   {
      glcd_command(0x3F, LEFT);             
      glcd_command(0x3F, RIGHT);
   }
   else
   {
      glcd_command(0x3E, LEFT);             
      glcd_command(0x3E, RIGHT);
   }

}


//Dergon komande ne GLCD=send a command to GLCD
void glcd_command(char command,char side1)
{
  DI=0;
  RW=0;
  glcd_setside(side1);
  LCD_DATA = command;
  _lcd_enable();
}

//Dergon byte(data) tek GLCD=send byte to GLCD
void glcd_write (unsigned char data)
{
  DI=1;
  RW=0;
  LCD_DATA = data;
  _lcd_enable();
}

//Zgjedh nje nga rreshtat per te shkruar nga 0 ne 7
//choose one of the pages(lines) to write to from 0 to 7
void glcd_setpage(unsigned char page)
{
  DI=0;
  RW=0;
  PORTD = 0b10111000 | page;
  _lcd_enable();
}

//Clock byte in
void _lcd_enable(void)
{
  Delay_us(1);
  ENABLE=1;
  Delay_us(1);
  ENABLE=0;
}


//Zgjedh nje nga anet e GLCD, LEFT ose RIGHT
//Choose one of the sides, LEFT or RIGHT
void glcd_setside(unsigned char sides)
{
  if (sides)                 // set a CS pin low to enable it
  {
    CS1 = 0;
    CS2 = 1;
  }
  else
  {
    CS1 = 1;
    CS2 = 0;
  }
}

//Zgjedh fillimin e germes. Percakton largesen e fillimit te germes nga ana e GLCD nga 0 ne 63
//Chooses where the caracter starts from compared to the side of the GLCD from 0 to 63 
void glcd_setxaddr(unsigned char y)
{
  DI=0;
  RW=0;
  LCD_DATA = 0b01000000 | (y & 0b00111111);
  _lcd_enable();
}

//Mbush GLCD sipas nje byte te caktuar. Nese do te boshatisesh GLCD byte=0x00
//Fills GLCD (the whole side) with a byte pattern. Of you want to clear the GLCD the byte should be byte=0x00
void glcd_mbush(char side, unsigned char fill)
{
  unsigned char x,y;
  if(side)
  {
      glcd_setside(LEFT);
      for (x=0; x<8; x++)
      {
        glcd_setpage(x);                // set the page (x)
        glcd_setxaddr(0);               // set the y address to 0
        RW=0;
        DI=1;                          // setup for data
        LCD_DATA=fill;
        for (y=0; y<64; y++)           // clear the row
        {
          _lcd_enable();
        }
      }
   }
   else
   {
      glcd_setside(RIGHT);
      for (x=0; x<8; x++)
      {
        glcd_setpage(x);                // set the page (x)
        glcd_setxaddr(0);               // set the y address to 0
        RW=0;
        DI=1;                          // setup for data
        LCD_DATA=fill;
        for (y=0; y<64; y++)           // clear the row
        {
          _lcd_enable();
        }
      }
   }
}



//Paraqet nje germe nje GLCD
//Puts a caracter on GLCD
void glcd_putch(char ch1,char side1,char start1,char page1)
{
  char e;
  glcd_setside(side1);
  glcd_setpage(page1);
  glcd_setxaddr(start1);
  for(e=0;e<5;e++)
    {
      glcd_write(alfab[ch1-32][e]);
    }
  glcd_write(0);
}

//Paraqet nje string ne GLCD
//Puts a string on GLCD
void glcd_puts( char *uau,char side1,char start1,char page1)
{
char e=0,*addr=uau;
glcd_setside(side1);
glcd_setxaddr(start1);
glcd_setpage(page1);
  while(*uau)              //uau=uau
  {
    for(e=0;e<5;e++)
    {
      glcd_write(alfab[*uau-32][e]);
    }
    *uau++;
    glcd_write(0);
  }
}


Does any one have a better code for line or dot functions?
Learning...Learning...still Learning

User avatar
marko.medic
mikroElektronika team
Posts: 173
Joined: 05 Jun 2008 08:07

#5 Post by marko.medic » 26 Sep 2008 13:08

Hi,

gjergji
Forum is not a place for advertising your business, site, company, or anything else. This is a professional forum, and we ask you to respect this.

Thank you for understanding.

Regards

gjergji
Posts: 25
Joined: 27 Sep 2007 22:34
Location: Albania Tirana tek liqeni

#6 Post by gjergji » 26 Sep 2008 16:24

The first deleted link was a site just to show others how my country is.

The second deletd link was a copy-paste link from google showing to others where my country is located on earth.

I am in no way affiliated to the first site (posted only the two that came up googling for my country).
If you think a google link (only with google content, map) "advertising your business, site, company, or anything else" then you must have deleted posts that have links of digikey, or even other forums or other companies tha make pic compilers.

I am using your dev-boards, compiler and forum and that is because i like them and respect you and your work.

If i wouldn't have respect for this profesional forum i wouldn't have posted my work here (or would have posted a library not source code).

There are many links of other companys on this forum, why haven't you deleted them.
http://www.mikroe.com/forum/viewtopic.p ... ht=ccsinfo

I respect you, your work and this forum and i want to use them but if your problem is else where just say it and i wil stop.
Learning...Learning...still Learning

User avatar
marko.medic
mikroElektronika team
Posts: 173
Joined: 05 Jun 2008 08:07

#7 Post by marko.medic » 29 Sep 2008 10:43

Hi,

Yes I'm aware of that post and others. Because of mentioned we are working, right now, on new rules for forum.
This document will be announced very soon. Mentioned rule is on that list, so I have to apply this rules for all new posts.
You could just say "google it" or something... Of course thank you for your post and code,
and I'm really glad to receive such a good feedback regarding our products from our customer.

I hope you understand and that there are no hard feelings.

Regards

gjergji
Posts: 25
Joined: 27 Sep 2007 22:34
Location: Albania Tirana tek liqeni

#8 Post by gjergji » 29 Sep 2008 16:34

Oh no no hard feelings at all.

Why do the new rules apply on me without being even made public?

I will read the new rules and keep them in mind for other posts.
Learning...Learning...still Learning

CGEngineering
Posts: 144
Joined: 09 May 2007 23:31
Location: Florence - Italy
Contact:

#9 Post by CGEngineering » 29 Sep 2008 17:33

gjergji wrote:There are many links of other companys on this forum, why haven't you deleted them.
http://www.mikroe.com/forum/viewtopic.p ... ht=ccsinfo
If you read this thread, it was an advice for the mikroE's team on how to improve their programming suite. I'm a MikroC beta-tester... i hope (i think!) that mikroelektronika team isn't mad at me :)

Bye
CG

ALBANIAN
Posts: 23
Joined: 22 Jul 2009 08:22

#10 Post by ALBANIAN » 23 Jul 2009 09:43

O GJERGJI KE NDONJE IDE, NGA TIA FILLIO PER TE MESUAR NDONJE NGA KETO GJUHET E PROGRAMIMIT PER PIC.. JAME AMATOR :D.. PO PATE NDONJE IDE ME THUAI SE VULLNETI NUK ME MUNGONE.

Bugz Bensce
Posts: 11
Joined: 09 Nov 2015 20:29

Re: KS0107 KS0108 library

#11 Post by Bugz Bensce » 27 Nov 2015 10:19

I have a question regarding this piece of code: "glcd_write(alfab[ch1-32][e]);". Why did you subtract 32 from ch1?

Post Reply

Return to “mikroC General”