Yeah, I was assuming that was the case.
So far over several years, I had only seen a handful of backpacks maybe 3 that used what I would call less than optimal backlight circuits. So I didn't focus too much on providing much information for those.
I figured that they would be rare.
You happen to be unlucky and have one of those backpacks.
Because of the way they used the transistor, there is no way to auto detect the backlight configuration on those backpacks. The bummer is that that none of the hd44780_I2Cexp examples will "just work" out of the box on that backpack. You will have to modify the constructor.
I've seen about as many of those in the past couple of weeks as I'd seen over the past 3-4 years.
So I may need to do some updates to the diag sketch to make it easier for people that end up with these types of backpacks.
Some of this is because I have made the code available to people before it was officially released and so documentation is lacking (Ok, non existent).
If you show me the diag output specifically the line that looks similar to this:
LCD at address: 0x38 | config: P01245673L | R/W control: Yes
From that, I can tell you what the constructor parameters need to be.
The config string shows the configuration parameters that the library auto detected and the last character is the backlight active level it determined which is wrong for that backpack.
That string would mean:
hd44780_I2Cexp lcd(0x38, I2Cexp_PCF8574, 0, 1, 2,4,5,6,7,3,LOW);
My guess is that your config probably matches the one I posted: P01245673L
That is what I call the dreaded "SYDZ" backpack.
Actually from at the photo yours is different and mine is worse as they put all the components on the other size of the PCB, so on mine if you solder it to the LCD, there is no way to adjust the contrast pot or set the address.
It works fine but because of the funky way they wired up their transistor, it fools the auto detection into incorrectly selecting active LOW when it is really active HIGH.
To configure the library, there are several different constructors including ones that accept a backpack ID.
I will warn you that these non automatic constructors are subject to change and that is the main reason why the hd44780 library is still in alpha state.
While they all work just fine, I may change the names used for some of parameters like expander type and backpack IDs.
So while I will try to preserve the names going into the final release, just be a bit forwarned, that what we get working now may break in future releases because of some the name changes of these parameters.
There are several backpack IDs in hd44780_I2Cexp.h but
if you have that config i noted above, you can use the backpack ID currently called I2Cexp_BOARD_SYDZ
So you would use
This will tell the library to auto locate the first backpack it sees on the i2c bus and treat it as a SYDZ backpack.
You can also specify the specific i2c address if you want:
hd44780_I2Cexp lcd(Your-specific-i2c-address, I2Cexp_BOARD_SYDZ);
Just keep in mind that I2Cexp_BOARD_SYDZ may change its name to something else before the final release.