Hi All,
I have added a LCD board to a project and was playing around with it on a nano that i was uploading to using the desktop editor, here is the opening code i use for that:
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#define I2C_ADDR 0x27 // <<----- Add your address here. Find it from I2C Scanner
#define BACKLIGHT_PIN 3
#define En_pin 2
#define Rw_pin 1
#define Rs_pin 0
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7
int n = 1;
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
I use a identical one for the mega on the web editor:
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#define I2C_ADDR 0x27 // <<----- Add your address here. Find it from I2C Scanner
#define BACKLIGHT_PIN 3
#define En_pin 2
#define Rw_pin 1
#define Rs_pin 0
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
however when i compile the version on the web editor i get the following error:
/tmp/291922641/build/libraries/jm_wire-1-0-1/jm_Wire.cpp.o (symbol from plugin): In function `TwoWire::available()':
(.text+0x0): multiple definition of `TwoWire::available()'
/tmp/291922641/build/libraries/Wire/Wire.cpp.o (symbol from plugin):(.text+0x0): first defined here
/home/admin/builder/opt/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld: Disabling relaxation: it will not work with multiple definitions
/tmp/291922641/build/libraries/jm_wire-1-0-1/jm_Wire.cpp.o (symbol from plugin): In function `TwoWire::available()':
(.text+0x0): multiple definition of `TwoWire::rxBufferLength'
/tmp/291922641/build/libraries/Wire/Wire.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/291922641/build/libraries/jm_wire-1-0-1/jm_Wire.cpp.o (symbol from plugin): In function `TwoWire::available()':
(.text+0x0): multiple definition of `TwoWire::rxBufferIndex'
/tmp/291922641/build/libraries/Wire/Wire.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/291922641/build/libraries/jm_wire-1-0-1/jm_Wire.cpp.o (symbol from plugin): In function `TwoWire::available()':
(.text+0x0): multiple definition of `TwoWire::read()'
/tmp/291922641/build/libraries/Wire/Wire.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/291922641/build/libraries/jm_wire-1-0-1/jm_Wire.cpp.o (symbol from plugin): In function `TwoWire::available()':
(.text+0x0): multiple definition of `TwoWire::rxBuffer'
/tmp/291922641/build/libraries/Wire/Wire.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/291922641/build/libraries/jm_wire-1-0-1/jm_Wire.cpp.o (symbol from plugin): In function `TwoWire::available()':
(.text+0x0): multiple definition of `TwoWire::peek()'
/tmp/291922641/build/libraries/Wire/Wire.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/291922641/build/libraries/jm_wire-1-0-1/jm_Wire.cpp.o (symbol from plugin): In function `TwoWire::available()':
(.text+0x0): multiple definition of `TwoWire::flush()'
/tmp/291922641/build/libraries/Wire/Wire.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/291922641/build/libraries/jm_wire-1-0-1/jm_Wire.cpp.o (symbol from plugin): In function `TwoWire::available()':
(.text+0x0): multiple definition of `TwoWire::onReceiveService(unsigned char*, int)'
/tmp/291922641/build/libraries/Wire/Wire.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/291922641/build/libraries/jm_wire-1-0-1/jm_Wire.cpp.o (symbol from plugin): In function `TwoWire::available()':
(.text+0x0): multiple definition of `TwoWire::user_onReceive'
and more but that takes it over the 9000 chracter limit!!
Has anyone any idea a) why and b) how i fix it please?
I have googled the error, but i confess i could not see how to fix it as it said about removing libraries etc, i have not added any libraries.
Many thanks