Pages: [1]   Go Down
Author Topic: I2C LCD .write issue  (Read 383 times)
0 Members and 1 Guest are viewing this topic.
Queens, New York
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2945
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

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

It also messed up when I added 33333333333333333333, I got this.
Quote
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.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Atlanta
Offline Offline
Full Member
***
Karma: 4
Posts: 128
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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


Queens, New York
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2945
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Atlanta
Offline Offline
Full Member
***
Karma: 4
Posts: 128
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


Western New York, USA
Offline Offline
Faraday Member
**
Karma: 26
Posts: 4119
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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
Logged

Pages: [1]   Go Up
Jump to: