Paul__B:
HugoPT:
make sure you remove your library from Arduino libraries folder! Don't just comment the folder, remove it to anywhere outside Arduino libraries folder.
I don't think you need the Chinese library(!), but when you install the fmalpartida library, you did have to move the original library - in its entirety - outside of the Ardunio tree.
niddu,
Stick with fm's library. That library has been thoroughly tested, and is known to work.
There is no need to switch horses at this point.
Make sure you get fm's library directly from his bitbucket site as there are some modified
versions floating around out there.
https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home
The key is to get the constructor correct.
That first constructor you used was really wrong.
There are only 8 output pins numbered 0-7 on the PCF8574 and you were using
pin numbers of 9, 10, 11, and 12. Definitely won't work with that.
The best way is to look at the board traces and see how it is hooked up to the LCD and then put in the
output port pin numbers in the constructor. That is is how it should be done.
It only takes a couple of minutes since these boards are pretty simple.
You might have to use an ohm meter since the backpack is already soldered to the LCD.
After you figure out which LCD pin each of the output port pins (P0 to P7) connects
to , you simply use those numbers in the constructor.
The constructor pin numbers are bit numbers or Px numbers on the PCF8574
and represent the LCD connections as follows:
lcd LiquidCrystal_IIC( iic_addr, En, Rw, Rs, d4, d5, d6, d7 , bl, bl_polarity);
The guesser sketch tries the all the known combinations of pinouts to try "guess" one that works.
One critical piece of information is what is the backlight doing?
Is it blinking at all? (It should blink 3 times when the constructor guess is correct)
If not, what about if you remove the jumper?
From looking at that photographs, it looks ,like it is wired up as follows:
PCF8574 LCD
P2 en
P1 rw
P0 rs
P4 d4
P5 d5
P6 d6
P7 d7
P3 backlight
(which seems to match Paul's backpack)
What isn't so clear is how the backlight is controlled.
so it is not possible to know the backlight polarity from looking at the photograph.
Are there any components on the back of the backpack?
If there are no components on the back,
it would mean that there are no pullups on the i2c bus.
Pullups on the i2c bus are mandatory. This isn't something you can leave off.
The AVR has its pullups enabled on the bus which often works, but they are way too
weak and well out of spec and sometimes don't work even when using a single device
like this with short wires.
Many people try to use i2c with Arduino without proper pullups, and often get away with it, but
proper pullups are required for reliable operation
and the built in pullups in the AVR are not strong enough.
This may be the cause for the errors that showed up from the guesser.
Another question, is while you say the "blocks" is the only thing you get,
are you seeing 1 row or 2 rows of blocks?
If you are seeing more than 1 row of blocks, the contrast pot is mis adjusted.
You should adjust the pot to make sure it is working. At one end the blocks will be full blocks
at the other end no pixels will show up , somewhere in the middle is where you need it to be.
--- bill