I am trying to use the Arduino UNO rev 3 with tIIC 1602 LiquidCrystal Display. It is a 16x2 LCD display with a I2C backpanel. I am using the Arduino IDE 1.7 on Windows 10.
I tried to determine the address of the display using the sketch described here:
#include <Wire.h>
void setup()
{
Wire.begin();
Serial.begin(9600);
while (!Serial); // Leonardo: wait for serial monitor
Serial.println("\nI2C Scanner");
}
void loop()
{
byte error, address;
int nDevices;
Serial.println("Scanning...");
nDevices = 0;
for(address = 1; address < 127; address++ )
{
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
Serial.print("I2C device found at address 0x");
if (address<16)
Serial.print("0");
Serial.print(address,HEX);
Serial.println(" !");
nDevices++;
}
else if (error==4)
{
Serial.print("Unknown error at address 0x");
if (address<16)
Serial.print("0");
Serial.println(address,HEX);
}
}
if (nDevices == 0)
Serial.println("No I2C devices found\n");
else
Serial.println("done\n");
delay(5000); // wait 5 seconds for next scan
}
serial monitor shows below
Scanning...
No I2C devices found
Scanning...
No I2C devices found
i have tried with other lcd pack but result was same
Your picture is terrible. It appears as though you have nothing but gray wires in your possession, and that you have them connected to pins A4 and A5 and 3.3V and 5V. Surely that is not right.
I'd recommend that you use my hd44780 library package.
It includes a hd44780_I2Cexp i/o class that is for that type of device.
It can auto discover the i2c address automatically as well as the pin mappings between the PCF8574 chip and the LCD.
It also includes a diagnostic sketch, I2CexpDiag, which can help isolate/diagnose issues.
-Multiple programs (I2C_scanner and I2CexpDiag)
-Multiple LCDs
You don't think it is the wires, but have not checked.
Have you tried another (preferably genuine) Arduino UNO?
It must be one of those four items. Or there is more connected than you have described.
I was going to say that I recently received an LCD with a bad backpack. The replacement complete LCD unit works, and I replaced the backpack and the LCD now works. So the backpacks, like any other electronic, can be bad.
bperrybap:
I'd recommend that you use my hd44780 library package.
It includes a hd44780_I2Cexp i/o class that is for that type of device.
It can auto discover the i2c address automatically as well as the pin mappings between the PCF8574 chip and the LCD.
It also includes a diagnostic sketch, I2CexpDiag, which can help isolate/diagnose issues.