On a project I'm working on I want to use and LCD (16X2) but I use a I2C backpack for the LCD to save up some pins to use for buttons but the backpack doesn't work properly for me.
How I hook it up:
5V->5V of arduino
GND->GND
SDA-> SDA (I've also tried A4)
SCL -> SCL (I've also tried A5)
I did use multiple library's but I get mostly the same result (I also changed the adress in the code): Only backlight goes on or the backlight starts flashing. If I use the I2C scanner I get 1 I2C device with 0x3F as adress. I made a schematic of the backpack which I've tried to mesure with my multimeter I'm not sure if the schematic that I made is 100% the same as the backpack itself most of the connections are right the transistor should be a J3Y transistor. Is there anything I forgot to change in the code or do I've used the wrong library's?
Does anything show on the LCD? Black boxes? Did you try adjusting the contrast pot? Which Arduino are you using?
The best library that I have found for those I2C LCDs is the hd44780 library. It will auto detect the I2C address and the I2C expander to LCD pin mapping. You would use the hd44780_I2Cexp class for that LCD. There is a diagnostic program in the examples. The library is well documented in the Wiki. You can install the library from the library manager in the IDE.
Yes I have adjusted the contrast pot. There doesn't show anything up on the LCD on the previous library's I used. I use the Arduino UNO rev.3 I think it is. I will search more on the Wiki of the library so I can get it working.
OK, now we need to get this clear - you say nothing shows up on the display, so you mean you do not get the dark blocks on the yellow-green display when you adjust the trimpot?
And the I2Cscanner shows the PCF8574 at 0x3F.
If you get nothing on the display, then pins 1 to 3 are not connected properly. Are they securely soldered to both modules?
You have cited the display, but not the backpack. You need to provide either a link to it on the Web, or a photograph.
I am sorry, but that is completely wrong in many places. I could sort-of guess which backpack it is but if you could get all the connections to the LCD module properly soldered (and presuming neither this or the backpack is faulty), bperrybap's HD44780 librarywill sort it out for you. You should not even try any other libraries; it would only confuse matters.
Just an incidental hint along the way - if you can break the connection on the backpack between the trimpot and 5 V without breaking any other connection, it will make it easier to work with (and waste half a milliamp less for what it is worth). This is a very long-standing design blunder carried over from the early days - it even appears on the last page of that datasheet.