Loading...
Pages: [1]   Go Down
Author Topic: I2C LCD .write issue  (Read 207 times)
0 Members and 1 Guest are viewing this topic.
Queens, New York
Offline Offline
Edison Member
*
Karma: 31
Posts: 1733
"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

UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W

"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown

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
Edison Member
*
Karma: 31
Posts: 1733
"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

UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W

"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown

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: 17
Posts: 3507
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
Print
 
Jump to: