I buy an LCD for my Arduino and I have been trying to make it work but it doesn't display anything, I check the data and it said this L"CM1602 IIC V1 Serial Board LCD for UNO, MEGA &
Duemilanove." this means that it's not compatible with my Arduino nano?
This is the data
That link is bad.
Always show us a good schematic of your proposed circuit.
Show us a good image of your ‘actual’ wiring.
Give links to components.
In the Arduino IDE, use Ctrl T or CMD T to format your code then copy the complete sketch.
Use the </> icon from the ‘posting menu’ to attach the copied sketch.
No, it doesn't mean that.
This is the link
And I'm just trying to use a normal Hello world program with the library LiquidCrystal-I2C-library master: GitHub - fdebrabander/Arduino-LiquidCrystal-I2C-library: Library for the LiquidCrystal LCD display connected to an Arduino board.
The backlight and the noBacklight are working the only thing that doesn't work its the letters
This is the code:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup()
{
// initialize the LCD
lcd.begin();
// Turn on the blacklight and print a message.
lcd.backlight();
lcd.print("Hello, world!");
}
void loop()
{
// Do nothing here...
}
It's supposed to be the same as using a uno and a nano?
What schematic? What wiring?
Are you sure you installed that library?
If you installed the one from the library manager, the one that looks like this:
...even though it says Frank De Brabander it installs the...
version which has a different hello example:
and suggests that your code might work better with an init()
instead of begin()
:
#include <LiquidCrystal_I2C.h>
// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27,16, 2);
void setup()
{
// initialize the LCD
lcd.init();
// Turn on the blacklight and print a message.
lcd.backlight();
lcd.print("Hello, world!");
}
void loop()
{
// Do nothing here...
}
The LiquidCrystal_I2C provenance in the IDE is a mess:
The repository was never maintained that well as the person who initially created it just created it to get it into the IDE library manager. He didn't have the skills to maintain it and there have been several easy to fix issues that have lagged for several years.
One issue is serious due to git tags being incorrectly created that confuses the IDE library manager's ability to get the proper versions.
It was handed over to johnrickman somewhat recently.
He basically copied it over to gitlab, changed its name a few times, then changed the license to BSD, which is not allowed under the LGPL terms and then abandoned this repository.
I pointed out the licensing issues, and he originally seemed open to correcting it.
But shortly after that, he deleted the gitlab repository.
At this point, he seems to have removed the repo on gitlab and abandoned his tandembyte account and hasn't been responding to issues on this repository.
Not sure how to even contact him at this point.
--bperrybap
I don't know if I understand all you want me to tell because English is not my first language I apologize for my English but I already try the library you have in there the LiquidCrystal_I2C-master and even I already do all like in your response it's not working for some reason it's not displaying the letters, I can turn the backLight on and off but I can't display the text
I don't know if its because I'm using an Arduino nano
There is another library that you recommend to me or some other method?
// vi:ts=4
// ----------------------------------------------------------------------------
// HelloWorld - simple demonstration of lcd
// Created by Bill Perry 2020-06-26
// bperrybap@opensource.billsworld.billandterrie.com
//
// This example code is unlicensed and is released into the public domain
// ----------------------------------------------------------------------------
//
// This sketch is for LCD devices like the Tsingtek Display HC1627 modules
// in i2c mode. Devices such as HC1627-B-LWH-I2C-30 or HC1627-SYH-I2C-30
// These devices have a native I2C interface rather than use a simple I2C
// i/o expander chip such as a PCF8574 or MCP23008.
//
// NOTE:
// These devices usually need external pullups as they typically are not on
// the module.
// WARNING:
// Use caution when using 3v only processors like arm and ESP8266 processors
// when interfacing with 5v modules as not doing proper level shifting or
// incorrectly hooking things up can damage the processor.
//
// Sketch prints "Hello, World!" on the lcd
//
// If initialization of the LCD fails and the arduino supports a built in LED,
// the sketch will simply blink the built in LED.
//
// ----------------------------------------------------------------------------
// While not all modules use the same pinout,
// Be VERY careful and check your datasheet
//
// This pin table is for the Tsingtek Display HC1627-SYH-I2C-30 or
// HC1627-SYH-I2C-30 module when it is strapped for i2c mode operation
//
// pin 14 is the pin closest to the edge of the PCB
// 14 - connect to gnd
// 13 - connect to vcc
// 12 - ID0 --- controls bit 1 of 7 bit i2c address, strap accordingly
// 11 - ID1 --- controls bit 2 of 7 bit i2c address, strap accordingly
// 10 - not connected
// 9 - not connected
// 8 - SCL
// 7 - SDA
// 6 - connect to gnd
// 5 - connect to gnd
// 4 - connect to gnd
// 3 - Vo Contrast Voltage input
// 2 - VCC (5v)
// 1 - LCD gnd
// 15 - Backlight Anode (+5v)
// 16 - Backlight Cathode (Gnd)
//
// I2C IDx address table
// ID1 ID0 ADDR
// L L 0x38/0x39
// L H 0x3A/0x3B
// H L 0x3C/0x3D
// H H 0x3E/0x3F
//
// library only needs to know the base address (the lower address)
//
// ----------------------------------------------------------------------------
// LiquidCrystal compability:
// Since hd44780 is LiquidCrystal API compatible, most existing LiquidCrystal
// sketches should work with hd44780 hd44780_HC1627_I2C i/o class once the
// includes are changed to use hd44780 and the lcd object constructor is
// changed to use the hd44780_HC1627_I2C i/o class.
#include <Wire.h>
#include <hd44780.h>
#include <hd44780ioClass/hd44780_HC1627_I2C.h> // i2c LCD i/o class header
// Note, i2c address can be specified or automatically located
// If you wish to use a specific address comment out this constructor
// and use the constructor below that specifies the address
// declare the lcd object for auto i2c address location
hd44780_HC1627_I2C lcd;
//
// manually enter base address of LCD.
// Base Addresses
// - 0x38, 0x3A, 0x3C, or 0x3E
// declare i2c address and constructor for specified i2c address
//const int i2c_addr = 0x38;
//hd44780_HC1627_I2C lcd(i2c_addr); // use device at this address
// LCD geometry
const int LCD_COLS = 16;
const int LCD_ROWS = 2;
void setup()
{
int status;
// initialize LCD with number of columns and rows:
// hd44780 returns a status from begin() that can be used
// to determine if initalization failed.
// the actual status codes are defined in <hd44780.h>
// See the values RV_XXXX
//
// looking at the return status from begin() is optional
// it is being done here to provide feedback should there be an issue
//
status = lcd.begin(LCD_COLS, LCD_ROWS);
if(status) // non zero status means it was unsuccesful
{
// begin() failed so blink error code using the onboard LED if possible
hd44780::fatalError(status); // does not return
}
// Print a message to the LCD
lcd.print("Hello, World!");
}
void loop() {}
As LarryD proposed in #2, draw a schematic with your wiring.
Btw. have you tried to turn the contrast potentiometer on the I2C board?
And last use the hd44780 library
/ffur
Yeah i already try everything with the potentiometer
Thanks for that solution but I just try that one and it's not printing anything idk what can I do or if maybe my LCD its broke
Schematic please. Especially the I2C connections.
Have you tried the hp44780 library.
Try an I2C scanner to see if the I2C address is correct.
/ffur
You need to do some configuration.
Your sketch I2C address must match your hardware address too.
Try this version for an address of 0x27, or change it to your address if different.
// ----------------------------------------------------------------------------
// HelloWorld - simple demonstration of lcd
// Created by Bill Perry 2020-06-26
// bperrybap@opensource.billsworld.billandterrie.com
//
// This example code is unlicensed and is released into the public domain
// ----------------------------------------------------------------------------
//
// This sketch is for LCD devices like the Tsingtek Display HC1627 modules
// in i2c mode. Devices such as HC1627-B-LWH-I2C-30 or HC1627-SYH-I2C-30
// These devices have a native I2C interface rather than use a simple I2C
// i/o expander chip such as a PCF8574 or MCP23008.
//
// NOTE:
// These devices usually need external pullups as they typically are not on
// the module.
// WARNING:
// Use caution when using 3v only processors like arm and ESP8266 processors
// when interfacing with 5v modules as not doing proper level shifting or
// incorrectly hooking things up can damage the processor.
//
// Sketch prints "Hello, World!" on the lcd
//
// If initialization of the LCD fails and the arduino supports a built in LED,
// the sketch will simply blink the built in LED.
//
// ----------------------------------------------------------------------------
// While not all modules use the same pinout,
// Be VERY careful and check your datasheet
//
// This pin table is for the Tsingtek Display HC1627-SYH-I2C-30 or
// HC1627-SYH-I2C-30 module when it is strapped for i2c mode operation
//
// pin 14 is the pin closest to the edge of the PCB
// 14 - connect to gnd
// 13 - connect to vcc
// 12 - ID0 --- controls bit 1 of 7 bit i2c address, strap accordingly
// 11 - ID1 --- controls bit 2 of 7 bit i2c address, strap accordingly
// 10 - not connected
// 9 - not connected
// 8 - SCL
// 7 - SDA
// 6 - connect to gnd
// 5 - connect to gnd
// 4 - connect to gnd
// 3 - Vo Contrast Voltage input
// 2 - VCC (5v)
// 1 - LCD gnd
// 15 - Backlight Anode (+5v)
// 16 - Backlight Cathode (Gnd)
//
// I2C IDx address table
// ID1 ID0 ADDR
// L L 0x38/0x39
// L H 0x3A/0x3B
// H L 0x3C/0x3D
// H H 0x3E/0x3F
//
// library only needs to know the base address (the lower address)
//
// ----------------------------------------------------------------------------
// LiquidCrystal compability:
// Since hd44780 is LiquidCrystal API compatible, most existing LiquidCrystal
// sketches should work with hd44780 hd44780_HC1627_I2C i/o class once the
// includes are changed to use hd44780 and the lcd object constructor is
// changed to use the hd44780_HC1627_I2C i/o class.
#include <Wire.h>
#include <hd44780.h>
//NOTE:
//hd44780_I2Cexp control LCD using I2C I/O expander backpack (PCF8574 or MCP23008)
//hd44780_I2Clcd control LCD with native I2C interface (PCF2116, PCF2119x, etc...)
#include <hd44780ioClass/hd44780_I2Cexp.h> //I2C expander i/o class header
// Note, i2c address can be specified or automatically located
// If you wish to use a specific address comment out this constructor
// and use the constructor below that specifies the address
// declare the lcd object for auto i2c address location
//hd44780_HC1627_I2C lcd;
//
// manually enter base address of LCD.
// Base Addresses
// - 0x38, 0x3A, 0x3C, or 0x3E
//If you do not know what your I2C address is, first run the "I2C_Scanner" sketch
//OR
//run the "I2CexpDiag" sketch that comes with the hd44780 library
//hd44780_I2Cexp lcd(0x3F);
// declare i2c address and constructor for specified i2c address
const int i2c_addr = 0x27;
hd44780_I2Cexp lcd(i2c_addr);
//hd44780_HC1627_I2C lcd(i2c_addr); // use device at this address
// LCD geometry
const int LCD_COLS = 16;
const int LCD_ROWS = 2;
void setup()
{
int status;
// initialize LCD with number of columns and rows:
// hd44780 returns a status from begin() that can be used
// to determine if initalization failed.
// the actual status codes are defined in <hd44780.h>
// See the values RV_XXXX
//
// looking at the return status from begin() is optional
// it is being done here to provide feedback should there be an issue
//
status = lcd.begin(LCD_COLS, LCD_ROWS);
if (status) // non zero status means it was unsuccesful
{
// begin() failed so blink error code using the onboard LED if possible
hd44780::fatalError(status); // does not return
}
// Print a message to the LCD
lcd.print("Hello, World!");
}
void loop()
{
}
Remember to rotate your contrast pot during every single test you try. Until you get it set, you could be claiming failure prematurely.
The hd44780 will do the scanning and connecting automatically if you leave the address out:
hd44780_I2Cexp lcd;
Yes
I like to show newcomers the whole story.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.