Markk
Well-known member
In order to spoof the libraries into using i2c_t3 instead of Wire, without editing anything, you would probably need to either modify the build process, or rely on directory ordering, or simply swap in the i2c_t3 in place of the default Wire library.
Thank you very much for this explanation and verification!
Based on your inspiration I tried the following but I failed FAILED:
1) Create a Wire directory in <sketchbook>/libraries:
2 ) Create a Wire.h file in it with the following contents:
Code:
#ifndef _WIRE_SPOOF_I2C_T3_
#define _WIRE_SPOOF_I2C_T3_
#include <i2c_t3.h>
typedef i2c_t3 TwoWire;
#endif
The idea being that I don't need to modify your i2c_t3 library as well.
But it failed:
Code:
C:\Users\Markus\Documents\Arduino\libraries\Adafruit_INA219\Adafruit_INA219.cpp: In member function 'void Adafruit_INA219::wireWriteRegister(uint8_t, uint16_t)':
C:\Users\Markus\Documents\Arduino\libraries\Adafruit_INA219\Adafruit_INA219.cpp:38:3: error: 'Wire' was not declared in this scope
Wire.beginTransmission(ina219_i2caddr);
^
C:\Users\Markus\Documents\Arduino\libraries\Adafruit_INA219\Adafruit_INA219.cpp: In member function 'void Adafruit_INA219::wireReadRegister(uint8_t, uint16_t*)':
C:\Users\Markus\Documents\Arduino\libraries\Adafruit_INA219\Adafruit_INA219.cpp:59:3: error: 'Wire' was not declared in this scope
Wire.beginTransmission(ina219_i2caddr);
^
C:\Users\Markus\Documents\Arduino\libraries\Adafruit_INA219\Adafruit_INA219.cpp: In member function 'void Adafruit_INA219::begin()':
C:\Users\Markus\Documents\Arduino\libraries\Adafruit_INA219\Adafruit_INA219.cpp:364:3: error: 'Wire' was not declared in this scope
Wire.begin();
^
Multiple libraries were found for "Wire.h"
Used: C:\Users\Markus\Documents\Arduino\libraries\Wire
Not used: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire
Error compiling.
Well I guess I'll stick to your solution.
Thanks again!
__Mark