Wire library produces errors like "i2c_t does not name a type"

1.1k Views Asked by At

I'm developing an application with ESP32 that uses the Wire.h library. However, I am getting an error that i2c_t is not a type name. Below is the source code and error code output. How can I solve this problem?

#include <Wire.h>
#include <Temperature_LM75_Derived.h>

TI_TMP100 myTmp100;
    
void initTmp100()
{  
    Wire.begine(); // errors in this part
    myTmp100.setResolution(myTmp100.Resolution_12_bits); // errors in this part as well
}

The same project works with platformio with same board (DOIT ESP32 DEVKIT V1).

Below is part of the error code output:

Wire.cpp:32: In file included from
     
Wire.h: 44:5: error: 'i2c_t' does not name a type; did you mean 'ino_t'?
       i2c_t * i2c
       ^~~~~
       ino_t
     
Wire.h: 64:5: error: 'i2c_err_t' does not name a type; did you mean 'esp_err_t'?
       i2c_err_t last_error; \\ @stickBreaker from esp32-hal-i2c.h
       ^~~~~~~~~
       esp_err_t
     
Wire.h: 87:5: error: 'i2c_err_t' does not name a type; did you mean 'esp_err_t'?
       i2c_err_t writeTransmission(uint16_t address, uint8_t* buff, uint16_t size, bool sendStop=true)
       ^~~~~~~~~
       esp_err_t 
0

There are 0 best solutions below