I've bought a cheap I2C LCD display (specs in the end of this question).
I can't make it print. I've tested with two displays of same model, so nothing is broken.
I am using the NewliquidCrystal 1.3.4 library, ie not the "normal" LiquidCrystal library. I'm trying with the I2C example called HelloWorld_i2c (link to example code). I've only changed the address from 0x37 to 0x27.
It compiles fine, but the result is only that the display flickers.
What is wrong and how do I fix it?
Super simple example flickers too
Well, this one gives just one blink.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27); // Set the LCD I2C address
void setup()
{
lcd.begin(16,2); // initialize the lcd
lcd.home (); // go home
lcd.print("Hello, ARDUINO ");
}
void loop()
{
}
Pictures
In the light it shows that the writing to the display is randomly jumping around.
In the dark, it shows that the background light flickers:
Details about the LCD display
Text on the backside
YwRobot Arduino
QAPASS
LCM1602 IIC V1
Text on the chip
TLPCF85747
HA
T62281
A N 1
I L knM988223
2 Answers 2
I was able to make the example run as intended, by using a different constructor call:
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
I am not able to tell you, what these parameters and values mean. However, the documentation for this constructor is shown below (source).
/*!
@method
@abstract Class constructor.
@discussion Initializes class variables and defines the I2C address of the
LCD. The constructor does not initialize the LCD.
@param lcd_Addr[in] I2C address of the IO expansion module. For I2CLCDextraIO,
the address can be configured using the on board jumpers.
@param En[in] LCD En (Enable) pin connected to the IO extender module
@param Rw[in] LCD Rw (Read/write) pin connected to the IO extender module
@param Rs[in] LCD Rs (Reset) pin connected to the IO extender module
@param d0[in] LCD data 0 pin map on IO extender module
@param d1[in] LCD data 1 pin map on IO extender module
@param d2[in] LCD data 2 pin map on IO extender module
@param d3[in] LCD data 3 pin map on IO extender module
*/
LiquidCrystal_I2C( uint8_t lcd_Addr, uint8_t En, uint8_t Rw, uint8_t Rs,
uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3 )
;
Try to pull the I2C sensor at the back of the LCD board, you can see that it is shorted to the SMD mounted on the back, just pull it a little so that it won't touch and short the conductors. This has happened to me, try it if this works.
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);