I reinstalled a previously working sketch to my UNO and now the behaviour of the lcd has changed.
Previously this example worked perfectly:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
void setup()
{
lcd.init(); // initialize the lcd
// Print a message to the LCD.
lcd.backlight();
lcd.print("Hello, world!");
}
void loop()
{
}
Now it only displays the very first character 'H'
This version does work though:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
void setup()
{
lcd.init(); // initialize the lcd
// Print a message to the LCD.
lcd.backlight();
lcd.print("H");
lcd.print("e");
lcd.print("l");
lcd.print("l");
lcd.print("o");
lcd.print(" ");
lcd.print("W");
lcd.print("o");
lcd.print("r");
lcd.print("l");
lcd.print("d");
}
void loop()
{
}
Can anyone shed me any light what is the reason of this change in behaviour and how to solve it?
Running version 1.8.3 on a W7pro PC
-
1Where does it print the letter H, at position 0, 0? If not, try lcd.home(); right after lcd.backlight();.VE7JRO– VE7JRO2018年02月13日 19:32:23 +00:00Commented Feb 13, 2018 at 19:32
-
ok thanks, I tried that but the result is exactly the sameON5MF Jurgen– ON5MF Jurgen2018年02月13日 19:51:27 +00:00Commented Feb 13, 2018 at 19:51
-
I've tried both of your sketches and they work fine. What happens if you remove the "!" character from your first sketch?VE7JRO– VE7JRO2018年02月13日 20:28:01 +00:00Commented Feb 13, 2018 at 20:28
-
1Yes the IDE was updated pretty recently (v1.8.3), the library is the same as before (LiquidCrystal_I2C1602V1).ON5MF Jurgen– ON5MF Jurgen2018年02月14日 09:07:27 +00:00Commented Feb 14, 2018 at 9:07
-
1ok got it, see my answer, thanks for the suggestionsON5MF Jurgen– ON5MF Jurgen2018年02月14日 18:11:26 +00:00Commented Feb 14, 2018 at 18:11
1 Answer 1
There seems to be an incompatibility between recent versions of the IDE and the library I was using.
Installing the latest version of the library from GitHub and replacing the lcd.init()
command with lcd.begin()
in my sketches solved the problem.
-
1Accept your own answer to close this question.user31481– user314812018年02月14日 18:19:07 +00:00Commented Feb 14, 2018 at 18:19
-
sorry, can't accept yet, I have to wait till tomorrowON5MF Jurgen– ON5MF Jurgen2018年02月14日 18:23:48 +00:00Commented Feb 14, 2018 at 18:23