Hi all.
I bought a 2x16 LCD with a built-in I2C "backpack" (model MOD-0001602, from oddWires.com.)
I haven't worked with i2C before, but I'm an experienced SW developer and a pretty handy electronics tinkerer.
I expected it to come with a data-sheet, but no joy. The ONLY thing provided is a code snippet on the page for the item: https://www.oddwires.com/16x2-lcd-display-with-i2c-interface/
(This should serve as a cautionary tale for anyone else who stumbles upon oddWires when searching for components. I ordered quite a bit of stuff and NONE of it came with documentation.)
The code snippet is the following:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
void setup()
{
lcd.begin(); // initialize the lcd
// Print a message to the LCD.
lcd.backlight();
lcd.print("Hello, world!");
}
void loop()
{
}
That appears to use the Newliquidcrystal library, based on the include of LiquidCrystal_I2C.h.
However, the format of the first command, LiquidCrystal_I2C lcd(0x27,16,2), appears to have changed. It looks like there is an initializer that just takes the address of the device, or there is an initializer that takes the address, the backlighPin, and the backlight polarity. (I've run the i2C scanner and verified that the device is at address 0x27.)
I've tried changing that line to LiquidCrystal_I2C lcd(0x27) and the begin command to lcd.begin(16, 2).
That sends commands to the LCD, and I can see the cursor moving, but the backlight turns off.
After some trial and error, I figured out that the command LiquidCrystal_I2C lcd(0x27, 3, POSITIVE) causes the LCD backlight to light, but I'm still not able to control the LCD correctly. With that change it shows
My guess is that the default i2C control pin assignments are wrong for this model, so the backpack isn't getting the correct signals.
Has anybody else used this particular model of LCD? Failing that, is there some way to examine the board or interrogate the I2C backpack to find out how to control it? I'm not optimistic about getting support from the seller, given the dreadful information that was provided.
The LCD's PCB has markings for the pins that connect it to the "backpack", but I can't tell the pin numbers for the backpack itself.