I can’t seem to get the WIO LTE US VERSION - 4G, CAT.1 board, v1.1 to communicate via I2C with a MPL3115A2
I get these errors:
C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp: In member function 'float Adafruit_MPL3115A2::getPressure()':
C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp:95:30: error: no matching function for call to 'TwoWire::endTransmission(int)'
_i2c->endTransmission(false); // end transmission
^
C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp:95:30: note: candidate is:
In file included from C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp:33:0:
C:\Users\liamt\AppData\Local\Arduino15\packages\Seeeduino\hardware\Seeed_STM32F4\1.2.5\libraries\Wire/Wire.h:85:11: note: uint8 TwoWire::endTransmission()
uint8 endTransmission(void);
^
C:\Users\liamt\AppData\Local\Arduino15\packages\Seeeduino\hardware\Seeed_STM32F4\1.2.5\libraries\Wire/Wire.h:85:11: note: candidate expects 0 arguments, 1 provided
C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp: In member function 'float Adafruit_MPL3115A2::getAltitude()':
C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp:134:30: error: no matching function for call to 'TwoWire::endTransmission(int)'
_i2c->endTransmission(false); // end transmission
^
C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp:134:30: note: candidate is:
In file included from C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp:33:0:
C:\Users\liamt\AppData\Local\Arduino15\packages\Seeeduino\hardware\Seeed_STM32F4\1.2.5\libraries\Wire/Wire.h:85:11: note: uint8 TwoWire::endTransmission()
uint8 endTransmission(void);
^
C:\Users\liamt\AppData\Local\Arduino15\packages\Seeeduino\hardware\Seeed_STM32F4\1.2.5\libraries\Wire/Wire.h:85:11: note: candidate expects 0 arguments, 1 provided
C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp: In member function 'void Adafruit_MPL3115A2::setSeaPressure(float)':
C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp:157:30: error: no matching function for call to 'TwoWire::endTransmission(int)'
_i2c->endTransmission(false);
^
C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp:157:30: note: candidate is:
In file included from C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp:33:0:
C:\Users\liamt\AppData\Local\Arduino15\packages\Seeeduino\hardware\Seeed_STM32F4\1.2.5\libraries\Wire/Wire.h:85:11: note: uint8 TwoWire::endTransmission()
uint8 endTransmission(void);
^
C:\Users\liamt\AppData\Local\Arduino15\packages\Seeeduino\hardware\Seeed_STM32F4\1.2.5\libraries\Wire/Wire.h:85:11: note: candidate expects 0 arguments, 1 provided
C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp: In member function 'float Adafruit_MPL3115A2::getTemperature()':
C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp:177:30: error: no matching function for call to 'TwoWire::endTransmission(int)'
_i2c->endTransmission(false); // end transmission
^
C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp:177:30: note: candidate is:
In file included from C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp:33:0:
C:\Users\liamt\AppData\Local\Arduino15\packages\Seeeduino\hardware\Seeed_STM32F4\1.2.5\libraries\Wire/Wire.h:85:11: note: uint8 TwoWire::endTransmission()
uint8 endTransmission(void);
^
C:\Users\liamt\AppData\Local\Arduino15\packages\Seeeduino\hardware\Seeed_STM32F4\1.2.5\libraries\Wire/Wire.h:85:11: note: candidate expects 0 arguments, 1 provided
C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp: In member function 'uint8_t Adafruit_MPL3115A2::read8(uint8_t)':
C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp:204:30: error: no matching function for call to 'TwoWire::endTransmission(int)'
_i2c->endTransmission(false); // end transmission
^
C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp:204:30: note: candidate is:
In file included from C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp:33:0:
C:\Users\liamt\AppData\Local\Arduino15\packages\Seeeduino\hardware\Seeed_STM32F4\1.2.5\libraries\Wire/Wire.h:85:11: note: uint8 TwoWire::endTransmission()
uint8 endTransmission(void);
^
C:\Users\liamt\AppData\Local\Arduino15\packages\Seeeduino\hardware\Seeed_STM32F4\1.2.5\libraries\Wire/Wire.h:85:11: note: candidate expects 0 arguments, 1 provided
C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp: In member function 'void Adafruit_MPL3115A2::write8(uint8_t, uint8_t)':
C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp:222:30: error: no matching function for call to 'TwoWire::endTransmission(int)'
_i2c->endTransmission(false); // end transmission
^
C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp:222:30: note: candidate is:
In file included from C:\Users\liamt\Documents\Arduino\libraries\Adafruit_MPL3115A2_Library-master\Adafruit_MPL3115A2.cpp:33:0:
C:\Users\liamt\AppData\Local\Arduino15\packages\Seeeduino\hardware\Seeed_STM32F4\1.2.5\libraries\Wire/Wire.h:85:11: note: uint8 TwoWire::endTransmission()
uint8 endTransmission(void);
^
C:\Users\liamt\AppData\Local\Arduino15\packages\Seeeduino\hardware\Seeed_STM32F4\1.2.5\libraries\Wire/Wire.h:85:11: note: candidate expects 0 arguments, 1 provided
exit status 1
Error compiling for board Wio Tracker LTE.
Invalid library found in C:\Users\liamt\Documents\Arduino\libraries\arduino_555462: no headers files (.h) found in C:\Users\liamt\Documents\Arduino\libraries\arduino_555462
I have been able to fix this error by adjusted the Wire.cpp to include the following:
`
uint8 TwoWire::endTransmission(uint8_t sendStop) { // ******* originally - endTransmission(void) *******
if (tx_buf_overflow) return EDATA;
```
i2c_start(port);
i2c_shift_out(port, (tx_addr << 1) | I2C_WRITE);
if (!i2c_get_ack(port)) return ENACKADDR;
// shift out the address we're transmitting to
for (uint8 i = 0; i < tx_buf_idx; i++) {
uint8 ret = writeOneByte(tx_buf[i]);
if (ret) {
//Serial1.println("endTransmission failed");
return ret; // SUCCESS is 0
}
}
if (sendStop) { // ******* originally - i2c_stop(port); with no if statement *******
i2c_stop(port);
}
tx_buf_idx = 0;
tx_buf_overflow = false;
return SUCCESS;
```
}
// This provides backwards compatibility with the original
// definition, and expected behaviour, of endTransmission
//
uint8 TwoWire::endTransmission(void) // ******* Originally function was not included *******
{
return endTransmission(true);
}
`
I also adjusted the Wire.h to include the following
uint8 endTransmission(void); uint8 endTransmission(uint8_t);
This allows the code to run but it does not read the sensor properly as these are the results from the MPL3115A2 sensor connected:
-11.25*C
When it should be 22.5*C