Am 28.06.2002 09:04:18, schrieb Dmitry <[email protected]>:
>Another minor thing - does anybody know how to upload a custom charset to the 
>lcd?

#define LCDDDADRSET   0x80 //0b10000000

void lcdDownloadFont( const void * fontdata, int size )
   {
   int i;
   lcdInstr(LCDCGADRSET);       //set address pointer to CG memory
   for (i = 0; i<size; i++)             //download bitmaps...
      {
      lcdPutchar( ((unsigned char *)fontdata)[i] );
      }
   }

const unsigned char font[] = {
    //Charchter 0
  0x10,   //00010000
  0x08,   //00001000
  0x04,   //00000100
  0x02,   //00000010
  0x01,   //00000001
  0x00,   //00000000
  0x00,   //00000000
  0x1f,   //00011111
    //Charchter 1
  0x00,   //00000000
  0x00,   //00000000
  0x00,   //00000000
  0x00,   //00000000
  0x00,   //00000000
  0x00,   //00000000
  0x00,   //00000000
  0x1f,   //00011111
    //Charchter 2
//...
};



int main() {
        //...
        lcdDownloadFont(font,sizeof(font));
        //...
}



Reply via email to