You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**begin(address, dataPin, clockPin)** begin function for ESP8266 & ESP32; **WARNING: not verified yet**
70
75
returns false if device address is incorrect or device cannot be reset.
71
-
-**begin(address, TwoWire \*wire = &Wire)** for platforms with multiple I2C busses.
72
-
-**read(bool fast = true)** blocks 4 (fast) or 15 (slow) milliseconds + actual read + math.
76
+
-**bool begin(address, TwoWire \*wire = &Wire)** for platforms with multiple I2C busses.
77
+
-**bool read(bool fast = true)** blocks 4 (fast) or 15 (slow) milliseconds + actual read + math.
73
78
Does read both the temperature and humidity.
74
-
-**isConnected()** check sensor is reachable over I2C. Returns false if not connected.
75
-
-**uint16_t readStatus()** details see datasheet and **Status fields** below
79
+
-**bool isConnected()** check sensor is reachable over I2C. Returns false if not connected.
80
+
-**uint16_t readStatus()** details see datasheet and **Status fields** below.
76
81
-**uint32_t lastRead()** in milliSeconds since start of program.
77
-
-**reset(bool hard = false)** resets the sensor, soft reset by default. Returns false if fails.
78
-
-**getHumidity()** computes the relative humidity in % based off the latest raw reading, and returns it
79
-
-**getTemperature()** computes the temperature in °C based off the latest raw reading, and returns it
80
-
-**getRawHumidity()** returns the raw two-byte representation of humidity directly from the sensor
81
-
-**getRawTemperature()** returns the raw two-byte representation of temperature directly from the sensor
82
+
-**bool reset(bool hard = false)** resets the sensor, soft reset by default. Returns false if fails.
83
+
-**float getHumidity()** computes the relative humidity in % based off the latest raw reading, and returns it.
84
+
-**float getTemperature()** computes the temperature in °C based off the latest raw reading, and returns it.
85
+
-**uint16_t getRawHumidity()** returns the raw two-byte representation of humidity directly from the sensor.
86
+
-**uint16_t getRawTemperature()** returns the raw two-byte representation of temperature directly from the sensor.
82
87
83
88
Note that the temperature and humidity values are recalculated on every call to getHumidity() and getTemperature(). If you're worried about the extra cycles, you should make sure to cache these values or only request them after you've performed a new reading.
84
89
@@ -88,67 +93,77 @@ Note that the temperature and humidity values are recalculated on every call to
88
93
-**getError()** returns last set error flag and clear it.
89
94
Be sure to clear the error flag by calling **getError()** before calling any command as the error flag could be from a previous command.
90
95
91
-
| Error | Symbolic | Description |
92
-
|:----:|:----|:----|
93
-
| 0x00 | SHT_OK | no error |
94
-
| 0x81 | SHT_ERR_WRITECMD | I2C write failed |
95
-
| 0x82 | SHT_ERR_READBYTES | I2C read failed |
96
-
| 0x83 | SHT_ERR_HEATER_OFF | Could not switch off heater |
97
-
| 0x84 | SHT_ERR_NOT_CONNECT | Could not connect |
98
-
| 0x85 | SHT_ERR_CRC_TEMP | CRC error in temperature |
99
-
| 0x86 | SHT_ERR_CRC_HUM | CRC error in humidity |
100
-
| 0x87 | SHT_ERR_CRC_STATUS | CRC error in statusfield |
0 commit comments