M2TKLIB Hello World with LiquidCrystal_I2C

bperrybap:
There is varying i2c to hd44780 hardware out there.
Some librarys are hard coded for a particular wiring/pin mapping and
some libraries like fm's allow the pin mapping to be configured.
So, In the case of fm's library the library is not the actual problem
but rather the problem comes down to the user properly filling in the constructor which configures the pin mappings
for the library.
fm's library has a default output pin mapping for how the wires/traces are connected
between the pcf8574 chip and the hd44780 interface.
It is unwise not to fill in the full constructor and use the default mappings since
different PCF8574 based boards wire up the connections differently.
The default pin mapping in the library is for fm's lcd i/o expander board
and many of the i2c based boards are not wired up the same way.

When the pin mapping is wrong/incorrect, the library will compile just fine,
but since it has been told the incorrect pin mappings, it will not be able to properly
initialize and drive the lcd.

Unfortunately, There is no way to have the library automatically detect the wiring
and automatically set up the pin mappings.

To ensure that i2c interface works with fm's library, it is best
to always properly fill in the full constructor which includes all the pin mappings rather than only fill
in the i2c address, which will cause the library use the pin mappings of fm's lcdio board, which is
different from many of the other i2c to hd44780 boards out there.
Plus, the default pin mappings do not include backlight control over the i2c interface since
fm's lcd i/o board does not support this.

If you fill in the full constructor, you can not only ensure that the pin mappings are correct,but
also configure the library for how to control the backlight over the i2c interface.

Well, thanks for filling me in on all that. I know nothing about constructors, and I really feel I have jumped in the deep end here. Still, it looks like there's hope of making it work, and I'm game to try.

I need to find out where and how to set up the pin mappings, and what they really should be. I'll try looking the code and google, but if anyone can lead me in the right direction, that would help :slight_smile: .