SHT3x icon indicating copy to clipboard operation
SHT3x copied to clipboard

Confusion with wire / wire1 in SHT3x.cpp

Open MikeErd opened this issue 4 years ago • 4 comments

In file SHT3x.cpp it seems that there is some mixture of using wire and wire1. Wire1 has not been defined.

MikeErd avatar Aug 11 '21 11:08 MikeErd

I have the same problem. It seems, that ESP8266 does not have "Wire1", but ESP32 does. So perhaps this library does not support ESP8266 any more. I also believe, that "Wire1" and "Wire"-code is the same. So perhaps a line #define Wire1 Wire might help.

eunger00 avatar Dec 12 '21 00:12 eunger00

#define Wire1 Wire

fixed that issue.

GeorgN avatar Jun 28 '22 14:06 GeorgN

Hello in which file did you #define Wire1 Wire? I tried in SHT3x.h, or SHT3x.cpp or in my sketch but instead of Wire is not defined I get the error: C:\Users\PC desktop Gilles\Documents\Arduino\libraries\SHT3x-master\SHT3x.cpp: In member function 'void SHT3x::Begin(int, int)': C:\Users\PC bureau Gilles\Documents\Arduino\libraries\SHT3x-master\SHT3x.cpp:16:27: error: no matching function for call to 'TwoWire::begin(int&, int&)' else Wire1.begin(SDA, SCL);

Impossible for the moment to use the SHT3x-master library even with the examples provided, the compilation gives the following error: C:\Users\PC desktop Gilles\Documents\Arduino\libraries\SHT3x-master\SHT3x.cpp: In member function 'void SHT3x::Begin(int, int)': C:\Users\PC bureau Gilles\Documents\Arduino\libraries\SHT3x-master\SHT3x.cpp:16:7: error: 'Wire1' was not declared in this scope else Wire1.begin(SDA, SCL); ^~~~~

I'm trying on an Arduino Uno! Thanks

mgnthe54 avatar Jan 19 '23 13:01 mgnthe54

By deleting in the file SHT3x.cpp all the program blocks calling on WIRE1 it works but it is not too clean if each time it is necessary to modify this library... Is it due to an update of the wire library? Which is no longer compatible with SHT3x.master? Should a new version be needed? Thanks

mgnthe54 avatar Jan 19 '23 13:01 mgnthe54