I2C LCD .write issue

I got an 20x4 I2C LCD and it is my first time using one, so I tried the Serial display example and at first it seemed to work fine until I entered more than 20 characters. I enter "1111111111111111111122222222222222222222" and I get this.

11111111111111111111
____________________ <= empty unused boxes
22222222222222222222
____________________ <= empty unused boxes

It also messed up when I added 33333333333333333333, I got this.

11111111111111111111
33333333333333333333
22222222222222222222
____________________ <= empty unused boxes

Why does lcd.write() do that?

And yes I did set it up correctly with the 20x4 compatible library.
lcd.begin(0x27,20,4); I also tried lcd.begin(0x27,16,2); to rule it out.

you're seeing the internal actual mapping of the display coming into play

+-----------------------+
|0 -------------------19 |
|40------------------59 |
|20------------------49 |
|60------------------79|
+------------------------+

Oh, so its normal, I thought it was a bug in the code. Ok then.

you could put your own wrapper around lcd.write so that when it hits character number 21, it does a setpos followed by the characters until it hits the next end-point, the setpos again etc

you're seeing the internal actual mapping of the display coming into play

Follow the LCD Addressing link at http://web.alfredstate.edu/weimandn for more information about this mapping.

Don