Well, got an LCD wired to an Arduino Leonardo via a cheapo LCM1602 I2C backpack that I snagged from fleabay. Searched for and found the following tutorial here, which I followed to the letter: http://forum.arduino.cc/index.php/topic,128635.0.html
The scanner finds the device at 0x20, and when I pop in the code and upload it, I do get the blinking backlight as promised, but no characters (just solid blocks).
Anything I'm missing? Is this not something that works happy with the Leonardo? I've gone back and triple checked my soldering work (not pretty, but no issues) and quad checked my wiring (Used both the predetermined SCL and SDA pins, as well as pins 2 and 3)
ubermick: I have also been having a hard time trying to get my "LCM1602 IIC" working.
I was able to get mine working in the end after a lot of hunting around.
I am still a total newbie to the Arduino.
Below is the code and the link to the library I used:
// Include Standard Wire Library
#include <Wire.h>
// Include I2C LCD Library (https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads/LiquidCrystal_V1.2.1.zip)
#include <LiquidCrystal_I2C.h>
// Set the pins on the I2C chip used for LCD connections:
// addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
LiquidCrystal_I2C lcd(0x20, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address 0x20
void setup()
{
lcd.begin(16,2); // initialize the lcd
}
void loop()
{
lcd.setCursor(2,0); //Start at character 3 on line 0
lcd.print("Hello World");
lcd.setCursor(2,1); //Start at character 3 on line 1
lcd.print("16 by 2 Line");
}
The problem here appears to be that whilst you have used the "I2Cscanner" sketch to locate the address of the backpack, you actually need to use an extended version, the "I2Cguesser" sketch (provided in this posting) in order to also determine the pin connections which the backpack uses internally to the LCD module, which vary from one "brand" of backpack to another.
Of course, still has me buggered, since I have the backpack soldered to the LCD!
The backpack should be soldered to the LCD. Those aren't the connections in question.
Here's what Paul said: "...in order to also determine the pin connections which the backpack uses internally to the LCD module... ". This refers to the connections between the IC on the backpack and the pins on the backpack.
And the point is - the sequence of the connections simply does not matter once you figure out what they are, which is what the "I2Cguesser" script does for you, because that is what that string of numbers,
ubermick:
But the guesser says that the backpack has to be NOT connected to the LCD screen in order for it to work?
hookup the i2c backpack and only the i2c backpack to the Arduino (make sure to use the needed pullup resistors - i2c needs them to work correctly)
That means that you must have no other I2C devices connected to the Arduino. You must have the display connected to the backpack otherwise how will you tell when the proper constructor has been guessed?
* When the correct configuration is guessed,
* the LCD will display the constructor
ubermick:
But the guesser says that the backpack has to be NOT connected to the LCD screen in order for it to work?
hookup the i2c backpack and only the i2c backpack to the Arduino (make sure to use the needed pullup resistors - i2c needs them to work correctly)
Don is correct.
What I meant to say is that you should hook up your backpack with LCD attached
but don't hook up any other i2c devices on the i2c bus.
I see your concern. Sorry about the confusion. I'll update the wording to be clearer.
Bill, no worries - read through the thing again, and it does indeed say that the end result will be displayed on the LCD, so my own fault for being dumb.
Anyways, got it going, but still no luck. The guesser goes through the eight attempts, but none of them did the job. Best I got was the first attempt (which is the default), which at least left the LCD on, but just gave me the same 16x2 array of blocked out characters.
One thing though, when I tried ohming out everything, to see if I mucked up my soldering I did notice that I was getting a reading on all pins, as if everything were through a 10k resistor. So unless this is common practice for these boards, I've either got a faulty one or a short in my soldering (which would surprise me, since while my coding skills are beginner, I'm competent enough with a soldering iron…)
ubermick:
Anyways, got it going, but still no luck. The guesser goes through the eight attempts, but none of them did the job. Best I got was the first attempt (which is the default), which at least left the LCD on, but just gave me the same 16x2 array of blocked out characters.
That actually looks like it might be working.
Try adjusting the contrast pot. Turn it until the pixels start to go off to see if it is just
an adjustment problem.
One thing though, when I tried ohming out everything, to see if I mucked up my soldering I did notice that I was getting a reading on all pins, as if everything were through a 10k resistor. So unless this is common practice for these boards, I've either got a faulty one or a short in my soldering (which would surprise me, since while my coding skills are beginner, I'm competent enough with a soldering iron…)
Not sure what you mean by that.
There are no 10k resisters.
What were you measuring?
It is hard to tell from the photo but it looks like the solder isn't fully melted into the holes.
You shouldn't see any gaps around the pin inside the hole.
Can you show a a closer clear photo of the soldering so we can take a look.
Also, it might be helpful to see the back side so we can see the actual backpack.
Wow. Wow. You honestly think that I'd be so stupid - so UTTERLY STUPID - as to ask for help without checking my soldering work? Really? I mean, I come on here, I ask for help, and you people just...
...oh.
Crap.
It was my soldering work. Quite literally the most embarrassing thing that's happened to me in quite a while.