Closed jannvck closed 2 years ago
Thanks for this issue.
I will fix it asap
As the ESP32 1.0.6 package defines
bool begin(int sda=-1, int scl=-1, uint32_t frequency=0); // returns true, if successful init of i2c bus
I will fix it to
bool begin(const int dataPin, const int clockPin)
Rationale is that I call Wire.begin() so I match that interface.
Develop branch created with fix. plus a fix for the getEIDB()
@jannvck Do you have time to confirm the develop branch is working for you? (I got no compile error)
Thank you for the quick fix! I can confirm the develop branch is working for me. The sensor reports proper values now. I have not tested getEIDB(), though.
Thanks for verifying, I will merge a.s.a.p
In the current ESP32 Arduino API the
TwoWire.begin()
method takes two int arguments where in your implementation two uint8_t arguments are provided which results in incorrect I2C pin configuration and wrong sensor measurement values reported on ESP32. Specifying int8_t arguments works as the underlying HAL initialisation method takes those.See the
begin()
method in Wire.cpp. See also thei2cInit
method in esp32-hal-i2c.h.Suggested solution: The constructor should be changed from
bool begin(const uint8_t dataPin, const uint8_t clockPin)
tobool begin(const int8_t dataPin, const int8_t clockPin)