But there are boxes on top row of LCD. No text. (Attachment 1)
My sketch is:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); // I found 0x27 by scan result
void setup()
{
lcd.init(); // initialize the lcd
// Print a message to the LCD.
lcd.backlight();
lcd.print("Hello, world!");
}
void loop()
{
}
How can I solve this problem? I tried many libraries but no luck. When I connect LCD direct to Arduino without I2C module, result is same. But I am sure that LCD is not corrupted because I have 2 more LCD's, result is same with them, too.
Most I2C libraries are written to support a specific I2C adapter since they have to account for the actual layout of the connections on that adapter.
Another choice is to use a library, such as the one by Francisco Malpartida (fm), that has provisions to deal with many I2C adapters since the layout of the connections can be specified in the 'constructor'.
Here is a blog that seems to use your I2C adapter with fm's library. I suggest that you modify his example program to just display a simple message in setup() and keep loop() blank as you did in the program that you posted above.
Make sure that you follow the instructions for installing that library - specifically you must remove all traces of the I2C libraries that you have previously tried and you must also remove or rename the default LiquidCrystal library.
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7); // 0x27 is the I2C bus address for an unmodified module
void setup()
{
lcd.setBacklightPin(3,POSITIVE);
lcd.setBacklight(HIGH); // NOTE: You can turn the backlight off by setting it to LOW instead of HIGH
lcd.begin(16, 2);
lcd.clear();
lcd.print("Hello");
}
void loop()
{
}
I use lastest version now. And i followed intallation instructions carefully.
When I use this sample sketch (HelloWorld_I2C)
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#define BACKLIGHT_PIN 13
LiquidCrystal_I2C lcd(0x27); // Set the LCD I2C address
//LiquidCrystal_I2C lcd(0x38, BACKLIGHT_PIN, POSITIVE); // Set the LCD I2C address
void setup()
{
// Switch on the backlight
pinMode ( BACKLIGHT_PIN, OUTPUT );
digitalWrite ( BACKLIGHT_PIN, HIGH );
lcd.begin(16,2); // initialize the lcd
lcd.home (); // go home
lcd.print("Hello, ARDUINO ");
lcd.setCursor ( 0, 1 ); // go to the next line
lcd.print (" FORUM - fm ");
delay ( 1000 );
}
void loop()
{
}
Backlight gone and no text, too.
I cant understand what is #define BACKLIGHT_PIN 13
I'm also having issues with my qapass 16x2 LCD that came with serial module presolidered on to the LCD. I noticed 3 sets of pads A0 to A2. Could these be the same links I see on other boards that have pads marked bs0 -bs2. The picture of this is here Setting up wide.hk OLED I2C display - Displays - Arduino Forum