1

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

asked Feb 13, 2018 at 19:06
7
  • 1
    Where does it print the letter H, at position 0, 0? If not, try lcd.home(); right after lcd.backlight();. Commented Feb 13, 2018 at 19:32
  • ok thanks, I tried that but the result is exactly the same Commented 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? Commented Feb 13, 2018 at 20:28
  • 1
    Yes the IDE was updated pretty recently (v1.8.3), the library is the same as before (LiquidCrystal_I2C1602V1). Commented Feb 14, 2018 at 9:07
  • 1
    ok got it, see my answer, thanks for the suggestions Commented Feb 14, 2018 at 18:11

1 Answer 1

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.

gre_gor
1,6824 gold badges18 silver badges28 bronze badges
answered Feb 14, 2018 at 18:18
2
  • 1
    Accept your own answer to close this question. Commented Feb 14, 2018 at 18:19
  • sorry, can't accept yet, I have to wait till tomorrow Commented Feb 14, 2018 at 18:23

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.