"locate" function for TextLCD does not seem to work

14 Apr 2011

I have recently started mbed.

For a start, I'm trying to use a LCD display, so that the following experiments can be debugged with it.

For some reason, the LCD does not show the second row properly. As shown below, "lcd.locate(8,1)" should put the variable at 8th position from the left. But the column number does not change the position at all. The row number, on the other hand, does work well.

The included library is

http://mbed.org/projects/cookbook/svn/TextLCD/trunk

The circuit and the actual lcd are shown in the images.

Could anyone help me for this issue?

#include "mbed.h"
#include "TextLCD.h"

TextLCD lcd(p24,p25,p26,p27,p28,p29,p30);

int main() {
    int count = 0;
    lcd.locate(4,0);
    lcd.printf("Hello World!");
    lcd.locate(0,1);
    lcd.printf("count = ");
    while(1) {
        lcd.locate(8,1);
        lcd.printf("%04d", count);
        count++;
        wait(1.0);
    }
}

/media/uploads/soujiro0725/110414_1057-0002.jpg /media/uploads/soujiro0725/110414_1057-0001.jpg

14 Apr 2011

Could your panel be using the alternate addressing mode? See if this makes a difference:

TextLCD lcd(p24,p25,p26,p27,p28,p29,p30, LCD16x2B);
15 Apr 2011

Thanks for the reply.

Hexley Ball wrote:

TextLCD lcd(p24,p25,p26,p27,p28,p29,p30, LCD16x2B);

It gave a compile error.

"Unrecognized token(E7) ..."

15 Apr 2011

You may be using an older version of TextLCD. Perhaps you could try the version at http://mbed.org/users/simon/libraries/TextLCD/livod0/docs/ to see if recognizes the token.