@@ -40,24 +40,43 @@ A derived class for using the SHT31 sensor with SoftWire (soft I2C) can be found
4040- https://github.com/RobTillaart/SHT31_SW
4141
4242
43+ #### 0.5.0 Breaking change
44+
45+ Version 0.5.0 introduced a breaking change.
46+ You cannot set the pins in ** begin()** any more.
47+ This reduces the dependency of processor dependent Wire implementations.
48+ The user has to call ** Wire.begin()** and can optionally set the Wire pins
49+ before calling ** begin()** .
50+
51+
52+ #### Related
53+
54+ - https://github.com/RobTillaart/SHT31
55+ - https://github.com/RobTillaart/SHT31_SW
56+ - https://github.com/RobTillaart/SHT31_SWW
57+ - https://github.com/RobTillaart/SHT85
58+
59+
4360## Interface
4461
4562``` cpp
4663#include " SHT31.h"
4764```
4865
66+ #### Constructor
4967
50- #### Base interface
51-
52- - ** SHT31(TwoWire \* wire = &Wire)** constructor. Optional select the I2C bus (Wire, Wire1 etc).
53- - ** bool begin(uint8_t address, uint8_t dataPin, uint8_t clockPin)** begin function for ESP8266 & ESP32;
54- returns false if device address is incorrect or device cannot be reset.
55- - ** bool begin(uint8_t dataPin, uint8_t clockPin)** same as above. With default SHT_DEFAULT_ADDRESS.
56- - ** bool begin(uint8_t address = SHT_DEFAULT_ADDRESS)**
68+ - ** SHT31(uint8_t address = SHT_DEFAULT_ADDRESS, TwoWire \* wire = &Wire)** constructor.
69+ Optional select address and the I2C bus (Wire, Wire1 etc).
70+ - ** bool begin()**
5771Returns false if device address is incorrect or device cannot be reset.
72+ - ** bool isConnected()** check sensor is reachable over I2C. Returns false if not connected.
73+ - ** uint8_t getAddress()** returns address set in the constructor.
74+
75+
76+ #### Read
77+
5878- ** bool read(bool fast = true)** blocks 4 (fast) or 15 (slow) milliseconds + actual read + math.
5979Does read both the temperature and humidity.
60- - ** bool isConnected()** check sensor is reachable over I2C. Returns false if not connected.
6180- ** uint16_t readStatus()** details see datasheet and ** Status fields** below.
6281- ** uint32_t lastRead()** in milliSeconds since start of program.
6382- ** bool reset(bool hard = false)** resets the sensor, soft reset by default. Returns false if it fails.
0 commit comments