Go Down

Topic: Writing to a 16x1 LCD. (Read 997 times) previous topic - next topic


I have a hd44780 16x1 lcd screen. The problem is that it has to be addressed as (8,2) instead of (16,1), now i want to print an array on it, which is longer then 8 letters, but i don't know how to auto move the cursor to the second segment when the word is > 8 letters.

Code: [Select]

char * words[] = {"abcdefghig",..............}
void setup() {
lcd.begin(8, 2);
lcd.setCursor(0, 0);

P.S I want to keep the array as i will add more words into it.The arduino will select which word to print using my inputs.


So you are saying that the memory layout is such that the 8th character is at lcd memory
location 0x40? (2nd line on most lcds)

If so, you need to have some special code in the low level lcd code to detect when the data is
crossing over and send command to reposition the cursor position.

Luckily there is a library that already does this.
Take a look at this library: http://www.pjrc.com/teensy/td_libs_LiquidCrystal.html

The lcd library code will detect a need to line wrap after column 7 and then reposition to the next line
automatically for you.

--- bill


So you have the LiquidCrystalFast library installed and it's not working?
Did you change your sketch to use the LiquidCrystalFast header and constructor?

--- bill

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131