I have had this a few times, where I have two identical sketches - checked with the Notepad++ compare feature.
One gives an error (redfinition of ****) and the other compiles fine
Here are the two files, the 'erroneous' one first
#include <Wire.h>
#include <LiquidCrystal_PCF8574.h>
#define DCSBIOS_IRQ_SERIAL
#include <DcsBios.h>
LiquidCrystal_PCF8574 lcd0(0x27); // set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_PCF8574 lcd1(0x26);
LiquidCrystal_PCF8574 lcd2(0x25);
int show;
void onCmscTxtJmrChange(char* newValue) {
lcd0.setCursor(0, 0);
lcd0.print(newValue);
}
DcsBios::StringBuffer<8> cmscTxtJmrBuffer(0x1096, onCmscTxtJmrChange);
void onCmscTxtChaffFlareChange(char* newValue) {
lcd1.setCursor(0, 0);
lcd1.print(newValue);
}
DcsBios::StringBuffer<8> cmscTxtChaffFlareBuffer(0x108e, onCmscTxtChaffFlareChange);
void onCmscTxtMwsChange(char* newValue) {
lcd2.setCursor(0, 0);
lcd2.print(newValue);
}
DcsBios::StringBuffer<8> cmscTxtMwsBuffer(0x12b0, onCmscTxtMwsChange);
void setup() {
lcd0.begin(16, 2);
lcd1.begin(16, 2);
lcd2.begin(16, 2);
DcsBios::setup();
}
void loop() {
DcsBios::loop();
lcd0.setBacklight(5);
lcd1.setBacklight(5);
lcd2.setBacklight(5);
}
and the working one
#include <Wire.h>
#include <LiquidCrystal_PCF8574.h>
#define DCSBIOS_IRQ_SERIAL
#include <DcsBios.h>
LiquidCrystal_PCF8574 lcd0(0x27); // set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_PCF8574 lcd1(0x26);
LiquidCrystal_PCF8574 lcd2(0x25);
int show;
void onCmscTxtJmrChange(char* newValue) {
lcd0.setCursor(0, 0);
lcd0.print(newValue);
}
DcsBios::StringBuffer<8> cmscTxtJmrBuffer(0x1096, onCmscTxtJmrChange);
void onCmscTxtChaffFlareChange(char* newValue) {
lcd1.setCursor(0, 0);
lcd1.print(newValue);
}
DcsBios::StringBuffer<8> cmscTxtChaffFlareBuffer(0x108e, onCmscTxtChaffFlareChange);
void onCmscTxtMwsChange(char* newValue) {
lcd2.setCursor(0, 0);
lcd2.print(newValue);
}
DcsBios::StringBuffer<8> cmscTxtMwsBuffer(0x12b0, onCmscTxtMwsChange);
void setup() {
lcd0.begin(16, 2);
lcd1.begin(16, 2);
lcd2.begin(16, 2);
DcsBios::setup();
}
void loop() {
DcsBios::loop();
lcd0.setBacklight(5);
lcd1.setBacklight(5);
lcd2.setBacklight(5);
}
Here is the error code
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\Slave_PCF8574_CMSC_multiple_LCD.ino:7:27: error: redefinition of 'LiquidCrystal_PCF8574 lcd0'
LiquidCrystal_PCF8574 lcd0(0x27); // set the LCD address to 0x27 for a 16 chars and 2 line display
^
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution.ino:12:23: note: 'LiquidCrystal_PCF8574 lcd0' previously declared here
LiquidCrystal_PCF8574 lcd0(0x27); // set the LCD address to 0x27 for a 16 chars and 2 line display
^~~~
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\Slave_PCF8574_CMSC_multiple_LCD.ino:8:27: error: redefinition of 'LiquidCrystal_PCF8574 lcd1'
LiquidCrystal_PCF8574 lcd1(0x26);
^
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution.ino:13:23: note: 'LiquidCrystal_PCF8574 lcd1' previously declared here
LiquidCrystal_PCF8574 lcd1(0x23);
^~~~
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\Slave_PCF8574_CMSC_multiple_LCD.ino:9:27: error: redefinition of 'LiquidCrystal_PCF8574 lcd2'
LiquidCrystal_PCF8574 lcd2(0x25);
^
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution.ino:14:23: note: 'LiquidCrystal_PCF8574 lcd2' previously declared here
LiquidCrystal_PCF8574 lcd2(0x25);
^~~~
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\Slave_PCF8574_CMSC_multiple_LCD.ino:10:5: error: redefinition of 'int show'
int show;
^~~~
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution.ino:15:5: note: 'int show' previously declared here
int show;
^~~~
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\Slave_PCF8574_CMSC_multiple_LCD.ino: In function 'void onCmscTxtJmrChange(char*)':
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\Slave_PCF8574_CMSC_multiple_LCD.ino:14:6: error: redefinition of 'void onCmscTxtJmrChange(char*)'
void onCmscTxtJmrChange(char* newValue) {
^~~~~~~~~~~~~~~~~~
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution.ino:19:6: note: 'void onCmscTxtJmrChange(char*)' previously defined here
void onCmscTxtJmrChange(char* newValue) {
^~~~~~~~~~~~~~~~~~
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\Slave_PCF8574_CMSC_multiple_LCD.ino: At global scope:
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\Slave_PCF8574_CMSC_multiple_LCD.ino:18:42: error: redefinition of 'DcsBios::StringBuffer<8> cmscTxtJmrBuffer'
DcsBios::StringBuffer<8> cmscTxtJmrBuffer(0x1096, onCmscTxtJmrChange);
^
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution.ino:23:26: note: 'DcsBios::StringBuffer<8> cmscTxtJmrBuffer' previously declared here
DcsBios::StringBuffer<8> cmscTxtJmrBuffer(0x1096, onCmscTxtJmrChange);
^~~~~~~~~~~~~~~~
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\Slave_PCF8574_CMSC_multiple_LCD.ino: In function 'void onCmscTxtChaffFlareChange(char*)':
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\Slave_PCF8574_CMSC_multiple_LCD.ino:20:6: error: redefinition of 'void onCmscTxtChaffFlareChange(char*)'
void onCmscTxtChaffFlareChange(char* newValue) {
^~~~~~~~~~~~~~~~~~~~~~~~~
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution.ino:25:6: note: 'void onCmscTxtChaffFlareChange(char*)' previously defined here
void onCmscTxtChaffFlareChange(char* newValue) {
^~~~~~~~~~~~~~~~~~~~~~~~~
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\Slave_PCF8574_CMSC_multiple_LCD.ino: At global scope:
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\Slave_PCF8574_CMSC_multiple_LCD.ino:24:49: error: redefinition of 'DcsBios::StringBuffer<8> cmscTxtChaffFlareBuffer'
DcsBios::StringBuffer<8> cmscTxtChaffFlareBuffer(0x108e, onCmscTxtChaffFlareChange);
^
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution.ino:29:26: note: 'DcsBios::StringBuffer<8> cmscTxtChaffFlareBuffer' previously declared here
DcsBios::StringBuffer<8> cmscTxtChaffFlareBuffer(0x108e, onCmscTxtChaffFlareChange);
^~~~~~~~~~~~~~~~~~~~~~~
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\Slave_PCF8574_CMSC_multiple_LCD.ino: In function 'void onCmscTxtMwsChange(char*)':
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\Slave_PCF8574_CMSC_multiple_LCD.ino:26:6: error: redefinition of 'void onCmscTxtMwsChange(char*)'
void onCmscTxtMwsChange(char* newValue) {
^~~~~~~~~~~~~~~~~~
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution.ino:31:6: note: 'void onCmscTxtMwsChange(char*)' previously defined here
void onCmscTxtMwsChange(char* newValue) {
^~~~~~~~~~~~~~~~~~
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\Slave_PCF8574_CMSC_multiple_LCD.ino: At global scope:
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\Slave_PCF8574_CMSC_multiple_LCD.ino:30:42: error: redefinition of 'DcsBios::StringBuffer<8> cmscTxtMwsBuffer'
DcsBios::StringBuffer<8> cmscTxtMwsBuffer(0x12b0, onCmscTxtMwsChange);
^
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution.ino:35:26: note: 'DcsBios::StringBuffer<8> cmscTxtMwsBuffer' previously declared here
DcsBios::StringBuffer<8> cmscTxtMwsBuffer(0x12b0, onCmscTxtMwsChange);
^~~~~~~~~~~~~~~~
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\Slave_PCF8574_CMSC_multiple_LCD.ino: In function 'void setup()':
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\Slave_PCF8574_CMSC_multiple_LCD.ino:32:6: error: redefinition of 'void setup()'
void setup() {
^~~~~
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution.ino:50:6: note: 'void setup()' previously defined here
void setup() {
^~~~~
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\Slave_PCF8574_CMSC_multiple_LCD.ino: In function 'void loop()':
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\Slave_PCF8574_CMSC_multiple_LCD.ino:40:6: error: redefinition of 'void loop()'
void loop() {
^~~~
F:\Users\LES\Documents\Arduino\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution\CF8574_CMSC_3_LCD_plus_switches_encoders_LEDs_mstr_caution.ino:59:6: note: 'void loop()' previously defined here
void loop() {
^~~~
Multiple libraries were found for "LiquidCrystal_PCF8574.h"
Used: F:\Users\LES\Documents\Arduino\libraries\LiquidCrystal_PCF8574
Not used: F:\Users\LES\Documents\Arduino\libraries\LiquidCrystal_PCF8574-master
exit status 1
Compilation error: redefinition of 'LiquidCrystal_PCF8574 lcd0'
Any idea what could be going on?
Cheers
Les