Roberto
30.07.2007, 23:08
Hallo
// Anfängeralarm ;-)
Ich möchte aus einem Datensatz, Werte auslesen, um damit ein Zeichen auf einem Grafik LCD darzustellen.
Ich habe dazu so eine Tabelle wie hier:
/************************************************** ************************************************** ******
The LCDlh155 library
lcd1font.c
LCD1 font & routines for LCD displays
Characters 32 - 255
by Michael Beigl, TecO, Universty of Karlsruhe
see the licence.txt
History:
Start Michael Beigl 9.12.2000
Preconditions:
Include Files Used:
lcdlh155.c
Predefined Variables: LCD_x_global,LCD_y_global
Predefined Constants: -
Predefined #defines: -
Postconditions:
Variables Defined:
struct _FONT_char {byte b[8];};
struct _FONT_char CONST _LCD1_1_FONT[32] .. struct _FONT_char CONST _LCD1_7_FONT[32]
Procedures defined:
void LCD_putc(char c)
#defines
************************************************** ************************************************** *****/
#ifndef _lcd1font_
#define _lcd1font_
#include "lcdlh155.c"
struct _FONT_char {byte b[8];};
struct _FONT_char CONST _LCD1_1_FONT[32] = /* the default 8x8 font
a mix of Times and Souvenier
named LCD1*/
{
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // char 32: space
{ 0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00, 0x18, 0x00 },
{ 0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x6C, 0x6C, 0xFE, 0x6C, 0xFE, 0x6C, 0x6C, 0x00 },
{ 0x18, 0x7E, 0xC0, 0x7C, 0x06, 0xFC, 0x18, 0x00 },
{ 0x00, 0xC6, 0xCC, 0x18, 0x30, 0x66, 0xC6, 0x00 },
{ 0x38, 0x6C, 0x38, 0x76, 0xDC, 0xCC, 0x76, 0x00 },
{ 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x18, 0x30, 0x60, 0x60, 0x60, 0x30, 0x18, 0x00 },
{ 0x60, 0x30, 0x18, 0x18, 0x18, 0x30, 0x60, 0x00 },
{ 0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00 },
{ 0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30 },
{ 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00 },
{ 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x80, 0x00 },
{ 0x7C, 0xCE, 0xDE, 0xF6, 0xE6, 0xC6, 0x7C, 0x00 },
{ 0x30, 0x70, 0x30, 0x30, 0x30, 0x30, 0xFC, 0x00 },
{ 0x78, 0xCC, 0x0C, 0x38, 0x60, 0xCC, 0xFC, 0x00 },
{ 0x78, 0xCC, 0x0C, 0x38, 0x0C, 0xCC, 0x78, 0x00 },
{ 0x1C, 0x3C, 0x6C, 0xCC, 0xFE, 0x0C, 0x1E, 0x00 },
{ 0xFC, 0xC0, 0xF8, 0x0C, 0x0C, 0xCC, 0x78, 0x00 },
{ 0x38, 0x60, 0xC0, 0xF8, 0xCC, 0xCC, 0x78, 0x00 },
{ 0xFC, 0xCC, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x00 },
{ 0x78, 0xCC, 0xCC, 0x78, 0xCC, 0xCC, 0x78, 0x00 },
{ 0x78, 0xCC, 0xCC, 0x7C, 0x0C, 0x18, 0x70, 0x00 },
{ 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00 },
{ 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x30 },
{ 0x18, 0x30, 0x60, 0xC0, 0x60, 0x30, 0x18, 0x00 },
{ 0x00, 0x00, 0x7E, 0x00, 0x7E, 0x00, 0x00, 0x00 },
{ 0x60, 0x30, 0x18, 0x0C, 0x18, 0x30, 0x60, 0x00 },
{ 0x3C, 0x66, 0x0C, 0x18, 0x18, 0x00, 0x18, 0x00 },
};
struct _FONT_char CONST _LCD1_2_FONT[32]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0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xFC, 0x00 },
{ 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x00 },
{ 0xC6, 0xC6, 0xC6, 0xC6, 0xD6, 0xFE, 0x6C, 0x00 },
{ 0xC6, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0xC6, 0x00 },
{ 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x30, 0x78, 0x00 },
{ 0xFE, 0xC6, 0x8C, 0x18, 0x32, 0x66, 0xFE, 0x00 },
{ 0x78, 0x60, 0x60, 0x60, 0x60, 0x60, 0x78, 0x00 },
{ 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x02, 0x00 },
{ 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x00 },
{ 0x10, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF },
};
struct _FONT_char CONST _LCD1_3_FONT[32] =
{
{ 0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00 },
{ 0xE0, 0x60, 0x60, 0x7C, 0x66, 0x66, 0xDC, 0x00 },
{ 0x00, 0x00, 0x78, 0xCC, 0xC0, 0xCC, 0x78, 0x00 },
{ 0x1C, 0x0C, 0x0C, 0x7C, 0xCC, 0xCC, 0x76, 0x00 },
{ 0x00, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00 },
{ 0x38, 0x6C, 0x64, 0xF0, 0x60, 0x60, 0xF0, 0x00 },
{ 0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8 },
{ 0xE0, 0x60, 0x6C, 0x76, 0x66, 0x66, 0xE6, 0x00 },
{ 0x30, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00 },
{ 0x0C, 0x00, 0x1C, 0x0C, 0x0C, 0xCC, 0xCC, 0x78 },
{ 0xE0, 0x60, 0x66, 0x6C, 0x78, 0x6C, 0xE6, 0x00 },
{ 0x70, 0x30, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00 },
{ 0x00, 0x00, 0xCC, 0xFE, 0xFE, 0xD6, 0xD6, 0x00 },
{ 0x00, 0x00, 0xB8, 0xCC, 0xCC, 0xCC, 0xCC, 0x00 },
{ 0x00, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0x78, 0x00 },
{ 0x00, 0x00, 0xDC, 0x66, 0x66, 0x7C, 0x60, 0xF0 },
{ 0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0x1E },
{ 0x00, 0x00, 0xDC, 0x76, 0x62, 0x60, 0xF0, 0x00 },
{ 0x00, 0x00, 0x7C, 0xC0, 0x70, 0x1C, 0xF8, 0x00 },
{ 0x10, 0x30, 0xFC, 0x30, 0x30, 0x34, 0x18, 0x00 },
{ 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00 },
{ 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x00 },
{ 0x00, 0x00, 0xC6, 0xC6, 0xD6, 0xFE, 0x6C, 0x00 },
{ 0x00, 0x00, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0x00 },
{ 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8 },
{ 0x00, 0x00, 0xFC, 0x98, 0x30, 0x64, 0xFC, 0x00 },
{ 0x1C, 0x30, 0x30, 0xE0, 0x30, 0x30, 0x1C, 0x00 },
{ 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00 },
{ 0xE0, 0x30, 0x30, 0x1C, 0x30, 0x30, 0xE0, 0x00 },
{ 0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xF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0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
};
struct _FONT_char CONST _LCD1_5_FONT[32] =
{
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00 },
{ 0x18, 0x18, 0x7E, 0xC0, 0xC0, 0x7E, 0x18, 0x18 },
{ 0x38, 0x6C, 0x64, 0xF0, 0x60, 0xE6, 0xFC, 0x00 },
{ 0x00, 0xC6, 0x7C, 0xC6, 0xC6, 0x7C, 0xC6, 0x00 },
{ 0xCC, 0xCC, 0x78, 0xFC, 0x30, 0xFC, 0x30, 0x30 },
{ 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00 },
{ 0x3E, 0x61, 0x3C, 0x66, 0x66, 0x3C, 0x86, 0x7C },
{ 0x00, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x7E, 0x81, 0x9D, 0xA1, 0xA1, 0x9D, 0x81, 0x7E },
{ 0x3C, 0x6C, 0x6C, 0x3E, 0x00, 0x7E, 0x00, 0x00 },
{ 0x00, 0x33, 0x66, 0xCC, 0x66, 0x33, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0xFC, 0x0C, 0x0C, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00 },
{ 0x7E, 0x81, 0xB9, 0xA5, 0xB9, 0xA5, 0x81, 0x7E },
{ 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00 },
{ 0x30, 0x30, 0xFC, 0x30, 0x30, 0x00, 0xFC, 0x00 },
{ 0x70, 0x18, 0x30, 0x60, 0x78, 0x00, 0x00, 0x00 },
{ 0x78, 0x0C, 0x38, 0x0C, 0x78, 0x00, 0x00, 0x00 },
{ 0x0C, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x00, 0x33, 0x33, 0x66, 0x7E, 0xC0, 0x80 },
{ 0x7F, 0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x00 },
{ 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0C, 0x38 },
{ 0x18, 0x38, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00 },
{ 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x7C, 0x00, 0x00 },
{ 0x00, 0xCC, 0x66, 0x33, 0x66, 0xCC, 0x00, 0x00 },
{ 0xC3, 0xC6, 0xCC, 0xDB, 0x37, 0x6F, 0xCF, 0x03 },
{ 0xC3, 0xC6, 0xCC, 0xDE, 0x33, 0x66, 0xCC, 0x0F },
{ 0xE1, 0x32, 0xE4, 0x3A, 0xF6, 0x2A, 0x5F, 0x86 },
{ 0x30, 0x00, 0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, 0x7C, 0x0C, 0xF8 },
{ 0xF0, 0x60, 0x7C, 0x66, 0x7C, 0x60, 0xF0, 0x00 },
{ 0x00, 0xCC, 0x00, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8 }
};
/////////////////////////////////////////////////////////////////////////////////////////////////
void LCD_putc(char c)
{ byte i,ii,y;
if (c=='\n') // line feed
{ LCD_x_pos(0);
if (LCD_y_global+9 < LCD_Y_MAX) LCD_y_pos(LCD_y_global +8);
else LCD_y_pos (0);
return;
}
if ((c<32)||(c>223)) return;
ii = (c-32) % 32;
y = LCD_y_global;
for (i=0; i<8; i++)
{
switch ((c-32)/32) {
case 0: LCD_write_byte(_LCD1_1_FONT[ii].b[i],0); break;
case 1: LCD_write_byte(_LCD1_2_FONT[ii].b[i],0);break;
case 2: LCD_write_byte(_LCD1_3_FONT[ii].b[i],0);break;
case 3: LCD_write_byte(_LCD1_4_FONT[ii].b[i],0);break;
case 4: LCD_write_byte(_LCD1_5_FONT[ii].b[i],0);break;
case 5: LCD_write_byte(_LCD1_6_FONT[ii].b[i],0);break;
case 6: LCD_write_byte(_LCD1_7_FONT[ii].b[i],0);break;
}
}
if (LCD_x_global<LCD_X_MAX) { LCD_y_pos(y); LCD_x_pos(LCD_x_global+1);}
else {
if (LCD_y_global==0) // right downmost position !
{ LCD_pos_0(); }
else // line feed
{ LCD_x_pos(0); }
}
}
#endif
Leider checke ich nicht ganz (Anfänger) wie das da abgerufen wird.
Habe das ganze schon in Bascom gemacht und da funktioniert es.
(jetzt will ich es auf C Umschreiben ](*,) )
In Bascom springe ich auf die entsprechende Stelle in der Tabelle
(ergibt sich aus dem ASC-Wert des Zeichens und einen Wert dazu..)
und lese dann von dort dann acht Werte ein für ein Zeichen.
Wie kann ich in C aus so eine Tabelle zugreifen ?
Habe schon das Forum durchgeschaut....
In einem Tutorial fand ich zum Befehl "struct", dass der eher für eine Zusammenfassung von mehrere Datentypen ist ?!
Ist der Befehl "struct" dazu gut und wie funktioniert der eigentlich?
Oder gibt es da noch einen bessern Ansatz?
Bitte um Hilfe :-)
l.G. Roberto
// Anfängeralarm ;-)
Ich möchte aus einem Datensatz, Werte auslesen, um damit ein Zeichen auf einem Grafik LCD darzustellen.
Ich habe dazu so eine Tabelle wie hier:
/************************************************** ************************************************** ******
The LCDlh155 library
lcd1font.c
LCD1 font & routines for LCD displays
Characters 32 - 255
by Michael Beigl, TecO, Universty of Karlsruhe
see the licence.txt
History:
Start Michael Beigl 9.12.2000
Preconditions:
Include Files Used:
lcdlh155.c
Predefined Variables: LCD_x_global,LCD_y_global
Predefined Constants: -
Predefined #defines: -
Postconditions:
Variables Defined:
struct _FONT_char {byte b[8];};
struct _FONT_char CONST _LCD1_1_FONT[32] .. struct _FONT_char CONST _LCD1_7_FONT[32]
Procedures defined:
void LCD_putc(char c)
#defines
************************************************** ************************************************** *****/
#ifndef _lcd1font_
#define _lcd1font_
#include "lcdlh155.c"
struct _FONT_char {byte b[8];};
struct _FONT_char CONST _LCD1_1_FONT[32] = /* the default 8x8 font
a mix of Times and Souvenier
named LCD1*/
{
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // char 32: space
{ 0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00, 0x18, 0x00 },
{ 0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x6C, 0x6C, 0xFE, 0x6C, 0xFE, 0x6C, 0x6C, 0x00 },
{ 0x18, 0x7E, 0xC0, 0x7C, 0x06, 0xFC, 0x18, 0x00 },
{ 0x00, 0xC6, 0xCC, 0x18, 0x30, 0x66, 0xC6, 0x00 },
{ 0x38, 0x6C, 0x38, 0x76, 0xDC, 0xCC, 0x76, 0x00 },
{ 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x18, 0x30, 0x60, 0x60, 0x60, 0x30, 0x18, 0x00 },
{ 0x60, 0x30, 0x18, 0x18, 0x18, 0x30, 0x60, 0x00 },
{ 0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00 },
{ 0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30 },
{ 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00 },
{ 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x80, 0x00 },
{ 0x7C, 0xCE, 0xDE, 0xF6, 0xE6, 0xC6, 0x7C, 0x00 },
{ 0x30, 0x70, 0x30, 0x30, 0x30, 0x30, 0xFC, 0x00 },
{ 0x78, 0xCC, 0x0C, 0x38, 0x60, 0xCC, 0xFC, 0x00 },
{ 0x78, 0xCC, 0x0C, 0x38, 0x0C, 0xCC, 0x78, 0x00 },
{ 0x1C, 0x3C, 0x6C, 0xCC, 0xFE, 0x0C, 0x1E, 0x00 },
{ 0xFC, 0xC0, 0xF8, 0x0C, 0x0C, 0xCC, 0x78, 0x00 },
{ 0x38, 0x60, 0xC0, 0xF8, 0xCC, 0xCC, 0x78, 0x00 },
{ 0xFC, 0xCC, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x00 },
{ 0x78, 0xCC, 0xCC, 0x78, 0xCC, 0xCC, 0x78, 0x00 },
{ 0x78, 0xCC, 0xCC, 0x7C, 0x0C, 0x18, 0x70, 0x00 },
{ 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00 },
{ 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x30 },
{ 0x18, 0x30, 0x60, 0xC0, 0x60, 0x30, 0x18, 0x00 },
{ 0x00, 0x00, 0x7E, 0x00, 0x7E, 0x00, 0x00, 0x00 },
{ 0x60, 0x30, 0x18, 0x0C, 0x18, 0x30, 0x60, 0x00 },
{ 0x3C, 0x66, 0x0C, 0x18, 0x18, 0x00, 0x18, 0x00 },
};
struct _F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, 0x30, 0x78, 0x00 },
{ 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xFC, 0x00 },
{ 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x00 },
{ 0xC6, 0xC6, 0xC6, 0xC6, 0xD6, 0xFE, 0x6C, 0x00 },
{ 0xC6, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0xC6, 0x00 },
{ 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x30, 0x78, 0x00 },
{ 0xFE, 0xC6, 0x8C, 0x18, 0x32, 0x66, 0xFE, 0x00 },
{ 0x78, 0x60, 0x60, 0x60, 0x60, 0x60, 0x78, 0x00 },
{ 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x02, 0x00 },
{ 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x00 },
{ 0x10, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF },
};
struct _FONT_char CONST _LCD1_3_FONT[32] =
{
{ 0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00 },
{ 0xE0, 0x60, 0x60, 0x7C, 0x66, 0x66, 0xDC, 0x00 },
{ 0x00, 0x00, 0x78, 0xCC, 0xC0, 0xCC, 0x78, 0x00 },
{ 0x1C, 0x0C, 0x0C, 0x7C, 0xCC, 0xCC, 0x76, 0x00 },
{ 0x00, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00 },
{ 0x38, 0x6C, 0x64, 0xF0, 0x60, 0x60, 0xF0, 0x00 },
{ 0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8 },
{ 0xE0, 0x60, 0x6C, 0x76, 0x66, 0x66, 0xE6, 0x00 },
{ 0x30, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00 },
{ 0x0C, 0x00, 0x1C, 0x0C, 0x0C, 0xCC, 0xCC, 0x78 },
{ 0xE0, 0x60, 0x66, 0x6C, 0x78, 0x6C, 0xE6, 0x00 },
{ 0x70, 0x30, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00 },
{ 0x00, 0x00, 0xCC, 0xFE, 0xFE, 0xD6, 0xD6, 0x00 },
{ 0x00, 0x00, 0xB8, 0xCC, 0xCC, 0xCC, 0xCC, 0x00 },
{ 0x00, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0x78, 0x00 },
{ 0x00, 0x00, 0xDC, 0x66, 0x66, 0x7C, 0x60, 0xF0 },
{ 0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0x1E },
{ 0x00, 0x00, 0xDC, 0x76, 0x62, 0x60, 0xF0, 0x00 },
{ 0x00, 0x00, 0x7C, 0xC0, 0x70, 0x1C, 0xF8, 0x00 },
{ 0x10, 0x30, 0xFC, 0x30, 0x30, 0x34, 0x18, 0x00 },
{ 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00 },
{ 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x00 },
{ 0x00, 0x00, 0xC6, 0xC6, 0xD6, 0xFE, 0x6C, 0x00 },
{ 0x00, 0x00, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0x00 },
{ 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8 },
{ 0x00, 0x00, 0xFC, 0x98, 0x30, 0x64, 0xFC, 0x00 },
{ 0x1C, 0x30, 0x30, 0xE0, 0x30, 0x30, 0x1C, 0x00 },
{ 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00 },
{ 0xE0, 0x30, 0x30, 0x1C, 0x30, 0x30, 0xE0, 0x00 },
{ 0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x10, 0x38, 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0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
};
struct _FONT_char CONST _LCD1_5_FONT[32] =
{
{ 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00 },
{ 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00 },
{ 0x18, 0x18, 0x7E, 0xC0, 0xC0, 0x7E, 0x18, 0x18 },
{ 0x38, 0x6C, 0x64, 0xF0, 0x60, 0xE6, 0xFC, 0x00 },
{ 0x00, 0xC6, 0x7C, 0xC6, 0xC6, 0x7C, 0xC6, 0x00 },
{ 0xCC, 0xCC, 0x78, 0xFC, 0x30, 0xFC, 0x30, 0x30 },
{ 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00 },
{ 0x3E, 0x61, 0x3C, 0x66, 0x66, 0x3C, 0x86, 0x7C },
{ 0x00, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x7E, 0x81, 0x9D, 0xA1, 0xA1, 0x9D, 0x81, 0x7E },
{ 0x3C, 0x6C, 0x6C, 0x3E, 0x00, 0x7E, 0x00, 0x00 },
{ 0x00, 0x33, 0x66, 0xCC, 0x66, 0x33, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0xFC, 0x0C, 0x0C, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00 },
{ 0x7E, 0x81, 0xB9, 0xA5, 0xB9, 0xA5, 0x81, 0x7E },
{ 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00 },
{ 0x30, 0x30, 0xFC, 0x30, 0x30, 0x00, 0xFC, 0x00 },
{ 0x70, 0x18, 0x30, 0x60, 0x78, 0x00, 0x00, 0x00 },
{ 0x78, 0x0C, 0x38, 0x0C, 0x78, 0x00, 0x00, 0x00 },
{ 0x0C, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x00, 0x33, 0x33, 0x66, 0x7E, 0xC0, 0x80 },
{ 0x7F, 0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x00 },
{ 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0C, 0x38 },
{ 0x18, 0x38, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00 },
{ 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x7C, 0x00, 0x00 },
{ 0x00, 0xCC, 0x66, 0x33, 0x66, 0xCC, 0x00, 0x00 },
{ 0xC3, 0xC6, 0xCC, 0xDB, 0x37, 0x6F, 0xCF, 0x03 },
{ 0xC3, 0xC6, 0xCC, 0xDE, 0x33, 0x66, 0xCC, 0x0F },
{ 0xE1, 0x32, 0xE4, 0x3A, 0xF6, 0x2A, 0x5F,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0x30, 0xCC, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8 },
{ 0xF0, 0x60, 0x7C, 0x66, 0x7C, 0x60, 0xF0, 0x00 },
{ 0x00, 0xCC, 0x00, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8 }
};
/////////////////////////////////////////////////////////////////////////////////////////////////
void LCD_putc(char c)
{ byte i,ii,y;
if (c=='\n') // line feed
{ LCD_x_pos(0);
if (LCD_y_global+9 < LCD_Y_MAX) LCD_y_pos(LCD_y_global +8);
else LCD_y_pos (0);
return;
}
if ((c<32)||(c>223)) return;
ii = (c-32) % 32;
y = LCD_y_global;
for (i=0; i<8; i++)
{
switch ((c-32)/32) {
case 0: LCD_write_byte(_LCD1_1_FONT[ii].b[i],0); break;
case 1: LCD_write_byte(_LCD1_2_FONT[ii].b[i],0);break;
case 2: LCD_write_byte(_LCD1_3_FONT[ii].b[i],0);break;
case 3: LCD_write_byte(_LCD1_4_FONT[ii].b[i],0);break;
case 4: LCD_write_byte(_LCD1_5_FONT[ii].b[i],0);break;
case 5: LCD_write_byte(_LCD1_6_FONT[ii].b[i],0);break;
case 6: LCD_write_byte(_LCD1_7_FONT[ii].b[i],0);break;
}
}
if (LCD_x_global<LCD_X_MAX) { LCD_y_pos(y); LCD_x_pos(LCD_x_global+1);}
else {
if (LCD_y_global==0) // right downmost position !
{ LCD_pos_0(); }
else // line feed
{ LCD_x_pos(0); }
}
}
#endif
Leider checke ich nicht ganz (Anfänger) wie das da abgerufen wird.
Habe das ganze schon in Bascom gemacht und da funktioniert es.
(jetzt will ich es auf C Umschreiben ](*,) )
In Bascom springe ich auf die entsprechende Stelle in der Tabelle
(ergibt sich aus dem ASC-Wert des Zeichens und einen Wert dazu..)
und lese dann von dort dann acht Werte ein für ein Zeichen.
Wie kann ich in C aus so eine Tabelle zugreifen ?
Habe schon das Forum durchgeschaut....
In einem Tutorial fand ich zum Befehl "struct", dass der eher für eine Zusammenfassung von mehrere Datentypen ist ?!
Ist der Befehl "struct" dazu gut und wie funktioniert der eigentlich?
Oder gibt es da noch einen bessern Ansatz?
Bitte um Hilfe :-)
l.G. Roberto