Click here to Skip to main content
14,428,415 members

C / C++ / MFC

 
AnswerRe: Error reading characters of string Pin
Albert Holguin28-Jul-15 7:23
professionalAlbert Holguin28-Jul-15 7:23 
QuestionRe: Error reading characters of string Pin
Richard MacCutchan27-Jul-15 22:02
communityengineerRichard MacCutchan27-Jul-15 22:02 
AnswerRe: Error reading characters of string Pin
Django_Untaken28-Jul-15 7:26
MemberDjango_Untaken28-Jul-15 7:26 
GeneralRe: Error reading characters of string Pin
Richard MacCutchan28-Jul-15 7:34
communityengineerRichard MacCutchan28-Jul-15 7:34 
GeneralRe: Error reading characters of string Pin
SundararamanS29-Jul-15 0:39
MemberSundararamanS29-Jul-15 0:39 
QuestionAccessing / printing two dimensional array of char using pointers Pin
Vaclav_26-Jul-15 5:06
MemberVaclav_26-Jul-15 5:06 
AnswerRe: Accessing / printing two dimensional array of char using pointers Pin
Richard MacCutchan26-Jul-15 6:51
communityengineerRichard MacCutchan26-Jul-15 6:51 
AnswerRe: Accessing / printing two dimensional array of char using pointers Pin
enhzflep26-Jul-15 7:47
Memberenhzflep26-Jul-15 7:47 
Well, you can easily look at the data-sheet for the I2C chip on the LCD board and at the one for the 1602/1604/2002/2004 LCD you're using. Once done, you can see that the LCD has a hardware cursor, and knows at which position on the display it is. It also has a means to write a character to the current cursor position.
Here's a quick list of the available commands: http://www.8051projects.net/lcd-interfacing/commands.php[^]
Not covered in that particular document, is the fact that you define custom bitmaps for characters - up to 4 or so at any one time. You could for instance, make a bitmap of a battery and then animate a charging display by changing the bitmap used for the battery 'character'.(but not actually changing the character drawn - it's the bitmap that this character refers to that is changed)

Here's a tool I whipped-up a couple of years back that makes drawing such custom characters easy. I've used this for both ascii/graphical LCDs - I don't remember if the output was suitable for both or just one or the other.
Lcd Character designer The 'save' button causes the changes made to a character in the top-pane to be written to the 'memory' of the LCD panel and causes the appearance of the currently chosen character to change.

As for the pointer stuff, you seem to be making it considerably more complex than it needs to be.
Here's a quick sample. I dont have access to an arduino this moment, so have used printf instead.
int main()
{
    char *stringTable[] = { "string 1", "string two", "string three", NULL };

    int i, n = sizeof(stringTable) / sizeof(*stringTable);

    // n-1 since the last element causes a crash.
    for (i=0; i<n-1; i++)
        printf("(%d chars): %s\n", strlen(stringTable[i]), stringTable[i]);

    printf("-------------\n");

    // a pointer to an array of pointers
    char **curPtr = stringTable;

    do
    {
        printf("%s\n", *curPtr);    // dereference to get the ptr to the string
        curPtr++;                   // point to the next element in the array o string pointers
    } while ( *curPtr );            // quit loop when we get to our NULL pointer.
}
"When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down 'happy'. They told me I didn't understand the assignment, and I told them they didn't understand life." - John Lennon

GeneralRe: Accessing / printing two dimensional array of char using pointers Pin
Vaclav_26-Jul-15 8:35
MemberVaclav_26-Jul-15 8:35 
QuestionRe: Accessing / printing two dimensional array of char using pointers Pin
CPallini26-Jul-15 21:49
mveCPallini26-Jul-15 21:49 
AnswerRe: Accessing / printing two dimensional array of char using pointers Pin
enhzflep27-Jul-15 1:54
Memberenhzflep27-Jul-15 1:54 
GeneralRe: Accessing / printing two dimensional array of char using pointers Pin
Vaclav_27-Jul-15 16:23
MemberVaclav_27-Jul-15 16:23 
GeneralRe: Accessing / printing two dimensional array of char using pointers Pin
enhzflep27-Jul-15 19:12
Memberenhzflep27-Jul-15 19:12 
GeneralSOLVED Re: Accessing / printing two dimensional array of char using pointers Pin
Vaclav_28-Jul-15 5:04
MemberVaclav_28-Jul-15 5:04 
QuestionRe: Accessing / printing two dimensional array of char using pointers Pin
David Crow27-Jul-15 5:59
MemberDavid Crow27-Jul-15 5:59 
AnswerRe: Accessing / printing two dimensional array of char using pointers Pin
Jeremy Falcon27-Jul-15 6:13
professionalJeremy Falcon27-Jul-15 6:13 
GeneralRe: Accessing / printing two dimensional array of char using pointers Pin
Vaclav_27-Jul-15 6:51
MemberVaclav_27-Jul-15 6:51 
GeneralRe: Accessing / printing two dimensional array of char using pointers Pin
Jeremy Falcon27-Jul-15 7:01
professionalJeremy Falcon27-Jul-15 7:01 
GeneralRe: Accessing / printing two dimensional array of char using pointers Pin
Richard MacCutchan27-Jul-15 8:20
communityengineerRichard MacCutchan27-Jul-15 8:20 
QuestionAdd button to vertical toolbar embedded in CPagerCtrl embedded in CDockingPane attached to CFrameWndEx Pin
Craig Hewitt24-Jul-15 10:02
professionalCraig Hewitt24-Jul-15 10:02 
QuestionC or C++ for customized embedded Linux, which is the best and why? Pin
Abdullah A._Mohamed22-Jul-15 21:16
MemberAbdullah A._Mohamed22-Jul-15 21:16 
AnswerRe: C or C++ for customized embedded Linux, which is the best and why? Pin
CPallini22-Jul-15 21:37
mveCPallini22-Jul-15 21:37 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Richard Deeming23-Jul-15 3:00
communityengineerRichard Deeming23-Jul-15 3:00 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
CPallini23-Jul-15 3:06
mveCPallini23-Jul-15 3:06 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Abdullah A._Mohamed23-Jul-15 20:19
MemberAbdullah A._Mohamed23-Jul-15 20:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.