Set digital pins hd44780

I think you are not yet understanding the issue(s).

You say you want to use pins for your i2c bus that are different than the AVR hardware i2c pins.

There are technical issues (incompatibilities) with the Adafruit_INA219 library and your desire to use different pins than the pins than the AVR Wire library uses.

The issue is not with the hd44780 library, the hd44780_I2Cexp i/o class can work with SoftwareWire - which allows configuring which pins are used.
Modifying the LiquidCrystal_I2C library to use the SoftwareWire library will not solve your issue(s).

You want to use different pins than what the AVR Wire library uses.
It is not possible to change the pins used by the AVR Wire library.
You could switch to the SoftwareWire library so you can configure the pins used.
While the hd44780_I2Cexp i/o class is compatible with the SoftwareWire library,
the Adafruit_INA219 library is hardcoded to use the Wire library.

So you have a few choices.

  • use SoftwareWire to reconfigure the i2c pins.
    -- This requires modifying the adafruit library to work with SoftwareWire
  • use a different Arduino board that has the additional pins you need.
  • figure out how to not need using the h/w i2c pins so they can be used for i2c

--- bill

2 Likes