10043
MIS
- Dec 7, 2008
- 1
i have written the following code i have used two dimentinal arries and i want each of the letters in ASCII code to be accessed as they are required by the print funtion. this program is used for an LCD i want to write in print funtion and want the outcome to be displayed in LCD. i dont think if im in the right track please help me.
thanks
char PRTFuntion (unsigned char*)
{
int CHARlength = 8;
char LCDByte = 0;
for ( int LCDPage = 0 ; LCDPage <=3; LCDPage++) // going through the 4 pages of the
{
for (int columnAD=0; columnAD<=79; columnAD++)
{
outportb (CONTROLLATCH,0x04);
outportb (CONTROLLATCH,0x05);
outportb (CONTROLLATCH,0x04);
}
outportb (DATALATCH, LCDByte);
for ( int LCDByte=0; LCDByte<=5; LCDByte++)
{
CHARlength++;
}
}
char ASCII[27][6] =
{
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // space
{0x1E, 0x68, 0x88, 0x68, 0x1E, 0x00 }, // 41 A
{0xFE, 0x92, 0x92, 0x92, 0x6C, 0x00 }, // 42 B
{0x38, 0x44, 0x82, 0x82, 0x44, 0x00 }, // 43 C
{0xFE,0x82, 0x82, 0x44, 0x38, 0x0 }, // 44 D
{0xFE,0x92, 0x92, 0x92,0x92, 0x00}, // 45 E
{0xFE, 0x90,0x90, 0x80, 0x80, 0x00 }, // 46 F
{0x38, 0x44,0x82, 0x82, 0x8A, 0x00}, // 47 G
{0xFE, 0x10,0x10, 0x10, 0xFE, 0x00}, // 48 H
{0x82,0x82, 0xFE, 0x82,0x82, 0x00 }, // 49 I
{0x4, 0x2, 0x2,0x82,0xFE, 0x00}, // 4a J
{0xFE, 0x10, 0x28, 0x44,0x82, 0x00},// 4b K
{0xFE,0x2, 0x2, 0x2, 0x2, 0x00}, // 4c L
{0xFE, 0x40, 0x20, 0x40, 0xFE, 0x00}, // 4d M
{0xFE,0x40, 0x38, 0x4, 0xFE, 0x00}, // 4e N
{0x38, 0x44, 0x82, 0x44,0x38, 0x00}, // 4f O
{0xFE, 0x90, 0x90, 0x90, 0x60, 0x00}, // 50 P
{0x38, 0x44, 0x82, 0x44, 0x38, 0x00}, // 51 Q
{0xFE, 0x90, 0x98, 0x94, 0x62, 0x00}, // 52 R
{0x064, 0x92, 0x92, 0x92, 0x4C, 0x00}, // 53 S
{0x80, 0x80, 0xFE, 0x80, 0x80, 0x00}, // 54 T
{0xFC, 0x2, 0x2, 0x2,0xFC, 0x00}, // 55 U
{0xE0, 0x1C, 0x2, 0x1C, 0xE0, 0x00}, // 56 V
{0xFE, 0x4, 0x8, 0x4, 0xFE, 0x00}, // 57 W
{0x82, 0x6C, 0x10, 0x6C, 0x82, 0x00}, // 58 X
{0x80, 0x40, 0x3E, 0x40, 0x80, 0x00}, // 59 Y
{0x86, 0x8A, 0x92, 0xA2, 0xC2, 0x00}}; // 5a Z
}
thanks
char PRTFuntion (unsigned char*)
{
int CHARlength = 8;
char LCDByte = 0;
for ( int LCDPage = 0 ; LCDPage <=3; LCDPage++) // going through the 4 pages of the
{
for (int columnAD=0; columnAD<=79; columnAD++)
{
outportb (CONTROLLATCH,0x04);
outportb (CONTROLLATCH,0x05);
outportb (CONTROLLATCH,0x04);
}
outportb (DATALATCH, LCDByte);
for ( int LCDByte=0; LCDByte<=5; LCDByte++)
{
CHARlength++;
}
}
char ASCII[27][6] =
{
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // space
{0x1E, 0x68, 0x88, 0x68, 0x1E, 0x00 }, // 41 A
{0xFE, 0x92, 0x92, 0x92, 0x6C, 0x00 }, // 42 B
{0x38, 0x44, 0x82, 0x82, 0x44, 0x00 }, // 43 C
{0xFE,0x82, 0x82, 0x44, 0x38, 0x0 }, // 44 D
{0xFE,0x92, 0x92, 0x92,0x92, 0x00}, // 45 E
{0xFE, 0x90,0x90, 0x80, 0x80, 0x00 }, // 46 F
{0x38, 0x44,0x82, 0x82, 0x8A, 0x00}, // 47 G
{0xFE, 0x10,0x10, 0x10, 0xFE, 0x00}, // 48 H
{0x82,0x82, 0xFE, 0x82,0x82, 0x00 }, // 49 I
{0x4, 0x2, 0x2,0x82,0xFE, 0x00}, // 4a J
{0xFE, 0x10, 0x28, 0x44,0x82, 0x00},// 4b K
{0xFE,0x2, 0x2, 0x2, 0x2, 0x00}, // 4c L
{0xFE, 0x40, 0x20, 0x40, 0xFE, 0x00}, // 4d M
{0xFE,0x40, 0x38, 0x4, 0xFE, 0x00}, // 4e N
{0x38, 0x44, 0x82, 0x44,0x38, 0x00}, // 4f O
{0xFE, 0x90, 0x90, 0x90, 0x60, 0x00}, // 50 P
{0x38, 0x44, 0x82, 0x44, 0x38, 0x00}, // 51 Q
{0xFE, 0x90, 0x98, 0x94, 0x62, 0x00}, // 52 R
{0x064, 0x92, 0x92, 0x92, 0x4C, 0x00}, // 53 S
{0x80, 0x80, 0xFE, 0x80, 0x80, 0x00}, // 54 T
{0xFC, 0x2, 0x2, 0x2,0xFC, 0x00}, // 55 U
{0xE0, 0x1C, 0x2, 0x1C, 0xE0, 0x00}, // 56 V
{0xFE, 0x4, 0x8, 0x4, 0xFE, 0x00}, // 57 W
{0x82, 0x6C, 0x10, 0x6C, 0x82, 0x00}, // 58 X
{0x80, 0x40, 0x3E, 0x40, 0x80, 0x00}, // 59 Y
{0x86, 0x8A, 0x92, 0xA2, 0xC2, 0x00}}; // 5a Z
}