I'm using a DFR LCD_Keypad shield and a I2C_LCD.
DFR LCD_Keypad is used on the control post and I2C_LCD shield on a remote control Panel.
By compiling a conflict message appears like this
C:\DOCUME~1\Pierre\LOCALS~1\Temp\build271406947852352415.tmp\Affichage_LCDs.cpp -o C:\DOCUME~1\Pierre\LOCALS~1\Temp\build271406947852352415.tmp\Affichage_LCDs.cpp.o
Affichage_LCDs.ino:30:22: error: conflicting declaration 'LiquidCrystal_I2C lcd'
Affichage_LCDs.ino:24:15: error: 'lcd' has a previous declaration as 'LiquidCrystal lcd'
Affichage_LCDs.ino: In function 'void setup()':
Affichage_LCDs.ino:44:12: error: no matching function for call to 'LiquidCrystal::init()'
Affichage_LCDs.ino:44:12: note: candidate is:
In file included from Affichage_LCDs.ino:12:0:
what would or could be the workaraound for this problem
Thanks for your support
Pierre
// afficheur LCD_Keypad
#include <LiquidCrystal.h>
#include <DFR_Key.h>
// afficheur I2C
#include <Wire.h> // I2C
#include <LiquidCrystal_I2C.h> // afficheur I2C
int tempo = 200;
// afficheur LCD_Keypad
//Pin assignments for DFRobot LCD Keypad Shield
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
// afficheur I2C_LCD
// initialise afficheur I2C
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
void setup() {
// afficheur LCD_Keypad
lcd.begin(16, 2); // initialize the LCD_Keypad
// afficheur I2C
lcd.init(); // initialize the I2C_lcd
}
void loop() {
/*
// affiche sur LCD Keypad
lcd.clear();
delay(tempo);
lcd.setCursor(0, 0);
lcd.print("Hello, world!");
*/
// affiche sur I2C_LCD
lcd.clear();
delay(tempo);
lcd.backlight();
lcd.print("Hello, world!");
delay(2000);
}