Hello everyone!
I’m trying to connect a LCD 1602 I2C to a Arduino Uno and display the message “hello, world!” but i couldn’t make the LCD display anything. I’ve tried like 4-5 tutorials, have the exact same hardware, same pin connections, same code. The LCD turns on but it display’s nothing.
Pins conected:
GND → GND Arduino
VCC → 5V
SDA → A4
SCL → A5
Code used:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
void setup ()
{
lcd.begin(16,2);
lcd.clear();
lcd.print("hello, world!");
}
void loop ()
{}
I tried with another LCD Display 1602 I2C and the same problem. Even changed the Arduino Uno with a Arduino Duemilanove and still nothing. I’ve been using a adress scanner for LCD to find out what adress it has. Code below:
#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
}
This showed me the adress was 0x3F and i changed the original code with “hello, world!”, at the adress with 0x3F. I updated the software, included the library but still no luck. I want to know what i’m doing wrong and what might be the problem and solution. Thanks a lot!