rjdelbueno
Member
The below code works just fine running my Teensy 3.2 and 16x2LCD with i2c backpack, when I use : #include "Wire.h"
However when I replace #include "Wire.h", with #include "i2c_t3.h", it does not work, and I get the following error:
Any ideas?
/var/folders/lf/jkw3y2rx05z9lq5gph7nhcrh0000gn/T/build3a63475326cceb961ea9a65a0cfc079d.tmp/libraries/Wire/Wire.cpp.o: In function `i2c0_isr':
/Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire/Wire.cpp:237: multiple definition of `i2c0_isr'
/var/folders/lf/jkw3y2rx05z9lq5gph7nhcrh0000gn/T/build3a63475326cceb961ea9a65a0cfc079d.tmp/libraries/i2c_t3/i2c_t3.cpp.o:i2c_t3.cpp.text.i2c0_isr+0x0): first defined here
/Applications/Arduino.app/Contents/Java/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld: Disabling relaxation: it will not work with multiple definitions
/var/folders/lf/jkw3y2rx05z9lq5gph7nhcrh0000gn/T/build3a63475326cceb961ea9a65a0cfc079d.tmp/libraries/Wire/Wire.cpp.o: In function `TwoWire::flush()':
/Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire/Wire.cpp:368: multiple definition of `Wire'
/var/folders/lf/jkw3y2rx05z9lq5gph7nhcrh0000gn/T/build3a63475326cceb961ea9a65a0cfc079d.tmp/libraries/i2c_t3/i2c_t3.cpp.o:/Users/robdelbueno/Documents/Arduino/libraries/i2c_t3/i2c_t3.h:727: first defined here
/Applications/Arduino.app/Contents/Java/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld: Warning: size of symbol `Wire' changed from 20 in /var/folders/lf/jkw3y2rx05z9lq5gph7nhcrh0000gn/T/build3a63475326cceb961ea9a65a0cfc079d.tmp/libraries/i2c_t3/i2c_t3.cpp.o to 16 in /var/folders/lf/jkw3y2rx05z9lq5gph7nhcrh0000gn/T/build3a63475326cceb961ea9a65a0cfc079d.tmp/libraries/Wire/Wire.cpp.o
collect2: error: ld returned 1 exit status
Multiple libraries were found for "i2c_t3.h"
Used: /Users/robdelbueno/Documents/Arduino/libraries/i2c_t3
Not used: /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/i2c_t3
Error compiling for board Teensy 3.2 / 3.1.
Why are these errors even referencing Wire, when it is not included?
Here is the sketch code:
#include "i2c_t3.h"
#include "Adafruit_LiquidCrystal.h"
// Connect via i2c, default address #0 (A0-A2 not jumpered)
Adafruit_LiquidCrystal lcd(0);
void setup() {
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, world!");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);
lcd.setBacklight(HIGH);
delay(500);
lcd.setBacklight(LOW);
delay(500);
}
However when I replace #include "Wire.h", with #include "i2c_t3.h", it does not work, and I get the following error:
Any ideas?
/var/folders/lf/jkw3y2rx05z9lq5gph7nhcrh0000gn/T/build3a63475326cceb961ea9a65a0cfc079d.tmp/libraries/Wire/Wire.cpp.o: In function `i2c0_isr':
/Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire/Wire.cpp:237: multiple definition of `i2c0_isr'
/var/folders/lf/jkw3y2rx05z9lq5gph7nhcrh0000gn/T/build3a63475326cceb961ea9a65a0cfc079d.tmp/libraries/i2c_t3/i2c_t3.cpp.o:i2c_t3.cpp.text.i2c0_isr+0x0): first defined here
/Applications/Arduino.app/Contents/Java/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld: Disabling relaxation: it will not work with multiple definitions
/var/folders/lf/jkw3y2rx05z9lq5gph7nhcrh0000gn/T/build3a63475326cceb961ea9a65a0cfc079d.tmp/libraries/Wire/Wire.cpp.o: In function `TwoWire::flush()':
/Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/Wire/Wire.cpp:368: multiple definition of `Wire'
/var/folders/lf/jkw3y2rx05z9lq5gph7nhcrh0000gn/T/build3a63475326cceb961ea9a65a0cfc079d.tmp/libraries/i2c_t3/i2c_t3.cpp.o:/Users/robdelbueno/Documents/Arduino/libraries/i2c_t3/i2c_t3.h:727: first defined here
/Applications/Arduino.app/Contents/Java/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld: Warning: size of symbol `Wire' changed from 20 in /var/folders/lf/jkw3y2rx05z9lq5gph7nhcrh0000gn/T/build3a63475326cceb961ea9a65a0cfc079d.tmp/libraries/i2c_t3/i2c_t3.cpp.o to 16 in /var/folders/lf/jkw3y2rx05z9lq5gph7nhcrh0000gn/T/build3a63475326cceb961ea9a65a0cfc079d.tmp/libraries/Wire/Wire.cpp.o
collect2: error: ld returned 1 exit status
Multiple libraries were found for "i2c_t3.h"
Used: /Users/robdelbueno/Documents/Arduino/libraries/i2c_t3
Not used: /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/i2c_t3
Error compiling for board Teensy 3.2 / 3.1.
Why are these errors even referencing Wire, when it is not included?
Here is the sketch code:
#include "i2c_t3.h"
#include "Adafruit_LiquidCrystal.h"
// Connect via i2c, default address #0 (A0-A2 not jumpered)
Adafruit_LiquidCrystal lcd(0);
void setup() {
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, world!");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);
lcd.setBacklight(HIGH);
delay(500);
lcd.setBacklight(LOW);
delay(500);
}