0

I've been playing with an Arduino Uno, trying to get a 16x2 LCD screen to work with an I2C controller. I've got this LCD screen and this controller. And I've been trying to get the sketch below to work.

#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7,3,POSITIVE);//, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
void setup()
{
    lcd.begin(16,2);
    lcd.backlight();
    lcd.setCursor(0, 0);
    lcd.print("Hello world!");
    lcd.setCursor(0, 1);
    lcd.print("Row number: ");
    lcd.setCursor(12, 1);
    lcd.print("2");
}
void loop()
{

}

I've used an address scanner to verify that the address is correct (39 [0x27]), but it still won't display anything. It lights up, and I've tried adjusting the contrast, but it just won't display any characters.

I'm wondering if the definition of which pins are which is correct, but I can't seem to find anything detailing how the numbers used in the sketch correlate to the pins on the controller, which then correlate to the pins on the LCD screen. If any body can give me some insight I'd appreciate it.

  • In case it helps, the pins on the LCD screen are labeled as follows: 1 VSS VDD V0 RS RW E D0 D1 D2 D3 D4 D5 D6 D7 A K 16 – Brad Richardson Nov 12 '15 at 14:21
  • So far I've tried a couple different things: I added a quick loop to blink the backlight, which does work with the constructor as shown; I added pull-up resistors to the data and clock pins, which didn't seem to affect anything; I tried switching the data and clock connections just in case, which then made the backlight not blink. I'll also add that I AM using the newer LiquidCrystal library from fmalpartida from here. Nothing has worked. Anybody have any more suggestions, please? – Brad Richardson Nov 13 '15 at 18:46
1

Yes, the pins can be different depending on the LCD and the controller. My favorite solution to this is to run a simple "i2c guesser" sketch that can be downloaded from the following forum thread (download link is at the bottom of the first post): http://forum.arduino.cc/index.php?topic=260510.0

With that sketch it usually only takes me a couple minutes to find the correct pin numbers.

  • The handful of combinations that sketch tried did not seem to work. Thanks for the info though. – Brad Richardson Nov 12 '15 at 14:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.