I'm using a LCD display 16x2 with PCF8574T I2C driver.
I connected it to my Arduino Mega 2560:
GND - to Arduino GND
VCC - to Arduino 5V
SDA - to Arduino SDA (pin 20)
SCL - to Arduino SCL (pin 21)
I'm using the library "LiquidCrystal_I2C1602V1", which is attached.
When I run the "Hello World" example, it prints out only the first letter "H".
Any ideas what can cause this issue?
I tried the same code on Arduino Uno, and have the same results.
//YWROBOT
//Compatible with the Arduino IDE 1.0
//Library version:1.1
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x20 for a 16 chars and 2 line display
void setup()
{
lcd.init(); // initialize the lcd
// Print a message to the LCD.
lcd.backlight();
lcd.print("Hello, world!");
}
void loop()
{
}
When I run the "Hello World" example, it prints out only the first letter "H".
Any ideas what can cause this issue?
There is a search box for the forum in the upper left of the webpage. Enter "i2c lcd only prints out first letter".
and you will find plenty of posts about the library issue causing your problem.
This library is pretty old in computer terms (>3 years).
My personal favourite LCD library is the one written by F. Malpartida and I never ran into problems with that library.
If you decide to take that new library you should make sure:
that you delete ANY other/previous LCD display library pieces on your PC (unfortunately most of the LCD libraries come with the same naming of the .h and .cpp files ...)
that you use the constructor (plus your LCD's individual I2C address) which is amongst the examples in the above mentioned Wiki.
gevorgparsyan,
If that library is producing a single character on your display, then the LiquidCyrstal_I2C library in the IDE library manager should work with that particular backpack. (it may not work with other backpacks)
Alternatively, you could use my hd44780 library.
You can read more about it here:
It can easily and quickly be installed using the IDE library manager.
It is faster and has several additional features not available in the other libraries including the ability to set execution times and read the LCD memory.
The io class is hd44780_I2Cexp
It will auto detect the backpack to figure its address, the chip type (PCF8574, MCP23008) and the pin mappings.
It includes several example sketches as well as a full diagnostic sketch to test the i2c interface and the LCD internal memory.