I bought an I2C lcd display but I can't get it to work. I added the library LiquideCrystal_I2C and I connected the cables but when I lift my code nothing happens. My screen is on and the first line is filled with rectangles. Here is the code I try:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
void setup() {
lcd.init();
lcd.clear();
lcd.backlight();
lcd.setCursor(1,0);
lcd.print("Hello World");
}
void loop() {
}
I hope you can help me
Antoine Pirot
Welcome to the forum
antoine_pir:
Here is the code I try:
Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'
Use code tags (the < CODE/ > icon above the compose window) to make it easier to read and copy for examination
See also FAQ - Arduino Forum for general rules on forum behaviour and etiquette.
Hello,
Welcome to the Arduino Forum.
This guide explains how to get the best out of this forum. Please read and follow the instructions below.
Being new here you might think this is having rules for the sake of rules, but that is not the case. If you don’t follow the guidelines all that happens is there is a long exchange of posts while we try to get you to tell us what we need in order to help you, which is fru…
PaulRB
April 24, 2023, 12:06pm
3
Have you tried adjusting the contrast pot?
After that, try running the i²c scanner sketch to confirm that 0x27 is the correct address for your display.
antoine_pir:
void setup() {
lcd.init();
lcd.clear();
lcd.backlight();
lcd.setCursor(1,0);
lcd.print("Hello World");
}
You wrote Hello world in Setup which will only show once startup
The things you want to loop or repeat kindly add them in void loop
kolaha
April 24, 2023, 12:11pm
5
antoine_pir:
filled with rectangles
this is a proof that LCD working. check A4/A5 swaping, check initial addres
problem is not the code..
looks just like the sim below..
UnoI2cLCD
bad connection maybe..
~q
thank you for all your answers but the problem was the address. It was not 0x27 but 0x3F in my case.
Thank you very much for your help.
1 Like
2112
April 24, 2023, 12:16pm
8
antoine_pir:
It was not 0x27 but 0x3F
Did you determine this by running the I2C Scanner?
For whatever reason that never works for me.
yes I found in this video.
system
Closed
October 21, 2023, 12:19pm
10
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.