PaulS:
LiquidCrystl_I2C *pLCD = NULL;
void setup()
{
// Find the desired address, and store it in a byte variable names addr
pLCD = new LiquidCrystal_I2C(addr, 20, 4);
}
Then, wherever you were using "lcd.", use "pLCD=>" insread.
Thanks, I'm no good with pointers, I've tried this sketch
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C *pLCD = NULL;
byte lcdAddress = 39;
void setup()
{
// initialize the LCD
pLCD = new LiquidCrystal_I2C(lcdAddress, 20, 4);
pLCD => begin();
// Turn on the blacklight and print a message.
pLCD => backlight();
pLCD => print("Hello, world!");
}
void loop()
{
// Do nothing here...
}
and I get this errors
Arduino:1.8.5 (Windows 10), Scheda:"Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
C:\Users\Maneat\AppData\Local\Temp\arduino_modified_sketch_19280\HelloWorld2.ino: In function 'void setup()':
HelloWorld2:11: error: expected primary-expression before '>' token
pLCD => begin();
^
HelloWorld2:11: error: 'begin' was not declared in this scope
pLCD => begin();
^
HelloWorld2:14: error: expected primary-expression before '>' token
pLCD => backlight();
^
HelloWorld2:14: error: 'backlight' was not declared in this scope
pLCD => backlight();
^
HelloWorld2:15: error: expected primary-expression before '>' token
pLCD => print("Hello, world!");
^
HelloWorld2:15: error: 'print' was not declared in this scope
pLCD => print("Hello, world!");
^
exit status 1
expected primary-expression before '>' token
Questo report potrebbe essere più ricco di informazioni abilitando l'opzione
"Mostra un output dettagliato durante la compilazione"
in "File -> Impostazioni"