Hi,
I’m trying to display characters on an LCD with my Arduino. Here’s what I’m using:
- Arduino Uno
- LCD/I²C-Module with PCF8574P expander (Datasheet, Shop)
- LCD TC1602A-08 (Datasheet, Shop)
I soldered the LCD/I²C-Module and the LCD together and wired the module to my Arduino according to this Reference: SDA to A4 and SCL to A5. When I hook the Arduino up to my PC the backlight on the LCD turns on.
I’m using this LiquidCrystal library instead of the one that comes with Arduino. Here’s my code:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x20, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
void setup()
{
lcd.begin(16,2);
lcd.setCursor(0,0);
lcd.print("Hello, world!");
}
void loop()
{
}
I found the adress 0x20 using the I2C scanner i found here. When I upload the code to my Arduino, nothing happens. I also tried using the LiquidCrystal_I2C constructor that takes only the adress, but that didn’t work either:
LiquidCrystal_I2C lcd(0x20);
I also tried matching the pins with the ones I found in the LCD datasheet but I couldn’t get that to work either:
//LiquidCrystal_I2C (uint8_t lcd_Addr, uint8_t En, uint8_t Rw, uint8_t Rs, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7)
LiquidCrystal_I2C lcd(0x20, 6, 5, 4, 11, 12, 13, 14);
To clarify, the code compiles and uploads successfully, no matter which variation I use, but it doesn’t show anything on the LCD. Any help is highly appreciated.
On a side note, I’ve been told that it would be bad to leave the LCD backlight at the highest contrast so I tried hooking it up to 3.3V instead of 5V. It still turns on and it’s not as bright. Should I be doing that?
Best regards