Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

LCD Interfacing program

venkates2218

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

paulfjujo

Advanced Member level 4
Joined
Jun 9, 2008
Messages
1,343
Helped
273
Reputation
546
Reaction score
265
Trophy points
1,363
Location
France 01800
Activity points
9,392
hello

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

Toggle Sidebar

Part and Inventory Search


Welcome to EDABoard.com

Sponsor

Sponsor

Design Fast


×
Top