[SOLVED] LCD Interfacing program

Status
Not open for further replies.

venkates2218

Full Member level 6
Joined
Sep 30, 2016
Messages
354
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Activity points
4,306
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.
 

hello

in your case, your font is defined only for this 4 charateres HELO
so, dont' remove -32 ..
Whers is defined your string ?
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…