Error with ENS160 Wire.h begin & two arguments

I downloaded GitHub - sciosense/ENS160_driver: Driver for the ScioSense ENS160 digital gas sensor.

However, it has a line in the begin function:
if (this->_sdaPin != this->_sclPin) Wire.begin(this->_sdaPin, this->_sclPin); else Wire.begin();

Compiling is throwing the error that Wire.h::begin doesn't have two arguments and commenting out to only Wire.begin() results in good compilation, but failure.

Am I missing a different Wire.h library?

C:\Users\99999999\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src/Wire.h:55:10: note: candidate expects 1 argument, 2 provided

The 2 arguments apply to a software I2C library. The standard (hardware) Wire library expects the (optional) slave ID of the board.

I read many questions on missing the library Wire
that it is included in the IDE. However, it is missing.
I uninstalled the Arduino IDE and reinstalled it but it is
still missing. I can't verify it because the library is missing.

I went to File Explorer under Arduino. There are quite a
few libraries but no wire or Wire. I went to github but I couldn't find it there either.

Thanks if you can help me.

I used the ENS160 before and I remember I had the same problem. What I did to make it work was just commented out this line

if (this->_sdaPin != this->_sclPin) Wire.begin(this->_sdaPin, this->_sclPin); else Wire.begin();

and replaced with just

Wire.begin();

I guess just make sure you are connecting to the correct pins ( SCL and SDA)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.