Hi,
ich habe das Nokie 3310 Display. Da hat jemand einen 3x5 Font erstellt, den ich gerne nutzen würde. Ich bekomme die Lib nicht umgebaut. Es erscheint nur Kram auf dem Display. Hier der Abschnitt aus der Lib:
void Nokia_3310_lcd::writeChar(unsigned char ch, char mode) {
unsigned char j;
#ifdef USE_GRAPHIC
if (cursor_col > LCDCOLMAX - 6) cursor_col = LCDCOLMAX - 6; // ensure space is available for the character
if (cursor_row > LCDROWMAX - 1) cursor_row = LCDROWMAX - 1; // ensure space is available for the character
lcd_buffer[cursor_row][cursor_col] = 0x00;
for(j=0; j<5; j++) {
lcd_buffer[cursor_row][cursor_col + j] = pgm_read_byte(&(smallFont [(ch-32)*5 + j] ));
}
lcd_buffer[cursor_row][cursor_col + 5] = 0x00;
for(j=0; j< 6; j++) {
if( mode == MENU_NORMAL )
writeData(lcd_buffer[cursor_row][cursor_col++]);
else
writeData(lcd_buffer[cursor_row][cursor_col++] ^ 0xff);
if (cursor_col >= LCDCOLMAX)
{
cursor_col=0;
cursor_row++;
if (cursor_row >= LCDROWMAX) cursor_row=0;
}
}
#else
for(j=0; j<5; j++) {
if( mode == MENU_NORMAL )
writeData( pgm_read_byte(&(smallFont [(ch-32)*5 + j] )) );
else
writeData( pgm_read_byte(&(smallFont [(ch-32)*5 + j] )) ^ 0xff );
}
writeData( (mode == MENU_NORMAL) ? 0x00 : 0xff );
#endif
}
Hier der Original 5x7 Char dazu (Teile...):
static const unsigned char smallFont[] PROGMEM =
{
0x00, 0x00, 0x00, 0x00, 0x00 , // sp
0x00, 0x00, 0x2f, 0x00, 0x00 , // !
0x00, 0x07, 0x00, 0x07, 0x00 , // "
0x14, 0x7f, 0x14, 0x7f, 0x14 , // #
0x24, 0x2a, 0x7f, 0x2a, 0x12 , // $
0x61, 0x66, 0x08, 0x33, 0x43 , // %
0x36, 0x49, 0x55, 0x22, 0x50 , // &
0x00, 0x05, 0x03, 0x00, 0x00 , // '
8< 8< 8< 8< 8< 8< 8< 8< 8< 8< 8< 8<
Hier nun der 3x5 Font:
static const unsigned char miniFont[] PROGMEM =
{
0x00, 0x00, //
0x24, 0x82, // !
0x5a, 0x00, // "
0x7f, 0xff, // #
0x2e, 0xba, // $
0x42, 0xa1, // %
0x7a, 0xb7, // , // '
0x14, 0x91, // (
0x44, 0x94, // )
0x55, 0x40, // *
8< 8< 8< 8< 8< 8< 8< 8< 8< 8< 8< 8<
Kann mir jemand einen Tipp geben wie ich die Lib auf den 3x5 umbaue? Ich habe das ganze von http://blog.thiseldo.co.uk/?p=383&cpage=1#comment-159.
Als ich die Frage auf http://blog.thiseldo.co.uk/?p=383&cpage=1#comment-159 postete kickte Andi das mal gerade kommentarlos. Danke Andi.