venkates2218
Full Member level 6
Code:
char font[][5] = {
{0x7f, 0x08, 0x08, 0x08, 0x7f} // 48 H
,
{0x7f, 0x49, 0x49, 0x49, 0x41} // 45 E
,
{0x7f, 0x40, 0x40, 0x40, 0x40} // 4c L
,
{0x3e, 0x41, 0x41, 0x41, 0x3e} // 4f O
};
void test_2(char *str) {
int i, column;
for (i = 0; str[i] != 0; i++){
for (column = 0; column < 5; column++) {
GLCD_Char(font[str[i] - 32][column]);
}
}
}
This is the program which used to display the character in GLCD. In font array all the values are given
When an string is passed to test_2 function, the character will displayed in GLCD display based on values inside the array.
I removed -32 to understand the program.After removing 32 unrelated font are displayed in display.
What is the role of 32 here…?
I dono how the function Is working. Please explain how string choosing the values inside array function.