Hello, I would like to run my LCD display with an I2C driver by using a software I2C on my arduino (need A4 and A5 for something else). I tried downloading soft I2C library and use it along with LiquidCrystal-I2C-library, but I did not manage to make it work. This is my code:
Oh sorry, I explained that badly. I am using the regular I2C on A4 and A5 for other I2C devices, but I need the LCD on a separate line, because I am turning the LCD off with a mosfet to save battery, and this causes other I2C devices to stop working, if they are on the same bus.
That would be nice, but I am kind of in a rush, is there a simple way to replicate the mux, for example with a few transistors? Or do I need to buy it?
Screpheep:
because I am turning the LCD off with a mosfet to save battery, and this causes other I2C devices to stop working, if they are on the same bus.
Seems to me you are using a common 1602 LCD. Have you checked just how much current it actually uses?
According to the datasheet, it is typical 350, maximum 600 μA plus another 250 μA if the library fails to release all data lines other then enable, plus the (equally small) current consumed by the I2C interface chip and the 500 μA of the voltage ladder and the ridiculous 1 mA consumed by the incorrectly wired contrast potentiometer (you need to cut the connection to +5 V).
Correctly wired and programmed, it should be less than 1 mA and in fact less than most of your other devices which you are still powering - not to mention the Arduino itself.