Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while compiling exampleUsage.ino #8

Open
stiamon77 opened this issue Aug 26, 2024 · 2 comments
Open

Error while compiling exampleUsage.ino #8

stiamon77 opened this issue Aug 26, 2024 · 2 comments

Comments

@stiamon77
Copy link

Hi
Error while compiling exampleUsage.ino

C:\Users\stiam\AppData\Local\Temp\.arduinoIDE-unsaved2024726-13276-1kakfg3.42te\exampleUsage\exampleUsage.ino: In function 'void setup()':
C:\Users\stiam\AppData\Local\Temp\.arduinoIDE-unsaved2024726-13276-1kakfg3.42te\exampleUsage\exampleUsage.ino:59:16: error: no matching function for call to 'SensirionI2cSht4x::begin(TwoWire&)'
   59 |     sht4x.begin(Wire);
      |     ~~~~~~~~~~~^~~~~~
In file included from C:\Users\stiam\AppData\Local\Temp\.arduinoIDE-unsaved2024726-13276-1kakfg3.42te\exampleUsage\exampleUsage.ino:37:
c:\Users\stiam\Documents\Arduino\libraries\Sensirion_I2c_SHT4x\src/SensirionI2cSht4x.h:74:10: note: candidate: 'void SensirionI2cSht4x::begin(TwoWire&, uint8_t)'
   74 |     void begin(TwoWire& i2cBus, uint8_t i2cAddress);
      |          ^~~~~
c:\Users\stiam\Documents\Arduino\libraries\Sensirion_I2c_SHT4x\src/SensirionI2cSht4x.h:74:10: note:   candidate expects 2 arguments, 1 provided

exit status 1

Compilation error: no matching function for call to 'SensirionI2cSht4x::begin(TwoWire&)'
@psachs
Copy link
Member

psachs commented Aug 26, 2024

Thanks for the report.
The latest update of the Arduino SHT4x library requires to also supply the I2C address to support all version of the SHT4x sensor.
You can compile the example by changing the line to

sht4x.begin(Wire, SHT40_I2C_ADDR_44);

We will update the examples within the next days to support the latest version of the SHT4x drivers.

@stiamon77
Copy link
Author

stiamon77 commented Aug 26, 2024

There is also a small error in the library name.
exampleUsage.ino & exampleLowPowerUsage.ino

#include <SensirionI2CSht4x.h>

SensirionI2CSht4x sht4x;

it's correct like this:

#include <SensirionI2cSht4x.h>

SensirionI2cSht4x sht4x;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@psachs @stiamon77 and others