11
2- [ ![ Arduino CI] ( https://github.com/robtillaart/SHT2x/workflows/Arduino%20CI/badge.svg )] ( https://github.com/marketplace/actions/arduino_ci )
3- [ ![ JSON check] ( https://github.com/RobTillaart/SHT2x/actions/workflows/jsoncheck.yml/badge.svg )] ( https://github.com/RobTillaart/SHT2x/actions/workflows/jsoncheck.yml )
2+ [ ![ Arduino CI] ( https://github.com/RobTillaart/SHT2x/workflows/Arduino%20CI/badge.svg )] ( https://github.com/marketplace/actions/arduino_ci )
43[ ![ Arduino-lint] ( https://github.com/RobTillaart/SHT2x/actions/workflows/arduino-lint.yml/badge.svg )] ( https://github.com/RobTillaart/SHT2x/actions/workflows/arduino-lint.yml )
4+ [ ![ JSON check] ( https://github.com/RobTillaart/SHT2x/actions/workflows/jsoncheck.yml/badge.svg )] ( https://github.com/RobTillaart/SHT2x/actions/workflows/jsoncheck.yml )
5+ [ ![ GitHub issues] ( https://img.shields.io/github/issues/RobTillaart/SHT2x.svg )] ( https://github.com/RobTillaart/SHT2x/issues )
6+
57[ ![ License: MIT] ( https://img.shields.io/badge/license-MIT-green.svg )] ( https://github.com/RobTillaart/SHT2x/blob/master/LICENSE )
68[ ![ GitHub release] ( https://img.shields.io/github/release/RobTillaart/SHT2x.svg?maxAge=3600 )] ( https://github.com/RobTillaart/SHT2x/releases )
9+ [ ![ PlatformIO Registry] ( https://badges.registry.platformio.org/packages/robtillaart/library/SHT2x.svg )] ( https://registry.platformio.org/libraries/robtillaart/SHT2x )
710
811
912# SHT2x
@@ -39,6 +42,13 @@ If you want to use more on one I2C bus one needs either an I2C multiplexer
3942or one should switch sensors on/off like the select in SPI communication.
4043
4144
45+ #### Related
46+
47+ - https://github.com/RobTillaart/SHT31
48+ - https://github.com/RobTillaart/SHT85
49+ - https://github.com/RobTillaart/tinySHT2x
50+
51+
4252## Interface
4353
4454``` cpp
@@ -89,13 +99,24 @@ Note: The raw temperature and raw humidity are ideal to minimize storage or to m
8999Experimental since 0.2.2 this interface can change in the future
90100Discussion see https://github.com/RobTillaart/SHT2x/issues/16
91101
92- - ** bool requestTemperature()**
93- - ** bool requestHumidity()**
94- - ** bool reqTempReady()**
95- - ** bool reqHumReady()**
96- - ** bool readTemperature()**
97- - ** bool readHumidity()**
98- - ** uint32_t lastRequest()**
102+ - ** bool requestTemperature()** starts new temperature request.
103+ Overrules optional existing / running request.
104+ - ** bool requestHumidity()** starts new humidity request.
105+ Overrules optional existing / running request.
106+ - ** bool reqTempReady()** returns true if temperature request is ready.
107+ - ** bool reqHumReady()** returns true if humidity request is ready.
108+ - ** bool requestReady()** checks if either temperature or humidity is ready.
109+ - ** bool readTemperature()** calculates the temperature from raw measurement.
110+ - ** bool readHumidity()** calculates the humidity from raw measurement.
111+ - ** uint32_t lastRequest()** timestamp of last request.
112+ - ** uint8_t getRequestType()** get current request type.
113+
114+
115+ | Value | Symbolic | Description | Notes |
116+ | :-------:| :----------------------------| :------------------------------| :-----------|
117+ | 0x00 | SHT2x_REQ_NONE | no request pending | |
118+ | 0x01 | SHT2x_REQ_TEMPERATURE | temperature request pending | |
119+ | 0x02 | SHT2x_REQ_HUMIDITY | humidity request pending | |
99120
100121TODO elaborate documentation.
101122
@@ -157,28 +178,28 @@ To be tested.
157178
158179#### Status fields
159180
160- From HTU20 datasheet
181+ From HTU20 datasheet (read for details).
161182
162- | bits | value | meaning |
163- | :------:| :------:| :--------------------|
164- | 00 | 0 | open circuit |
165- | 01 | 1 | temperature reading |
166- | 10 | 2 | humidity reading |
167- | 11 | 3 | closed circuit |
183+ | bits | value | Symbolic | Description |
184+ | :------:| :------- :| :------------------------------ | :-- --------------------|
185+ | 00 | 0 | SHT2x_STATUS_OPEN_CIRCUIT | open circuit |
186+ | 01 | 1 | SHT2x_STATUS_TEMPERATURE | temperature reading |
187+ | 10 | 2 | SHT2x_STATUS_HUMIDITY | humidity reading |
188+ | 11 | 3 | SHT2x_STATUS_CLOSED_CIRCUIT | closed circuit |
168189
169190
170191#### Resolution
171192
172193** Warning experimental**
173- - needs more testing as results are not in line with the datasheet.
194+ - needs more testing as the results are not in line with the datasheet.
174195- only tested on a HTUxx sensor.
175196- tested with ** SHT2X_resolution.ino**
176197
177198- ** void setResolution(uint8_t res)** res = 0..3, other values return false.
178199- ** uint8_t getResolution()** returns resolution set 0..3.
179200
180201
181- Datasheet SHT20 Table 8: ( resolution)
202+ Datasheet SHT20 Table 8: resolution
182203
183204| RES | Humidity | Temperature |
184205| :-----:| :----------:| :-------------:|
@@ -187,7 +208,8 @@ Datasheet SHT20 Table 8: (resolution)
187208| 2 | 10 bit | 13 bit |
188209| 3 | 11 bit | 11 bit |
189210
190- Datasheet SHT20 Table 7: (timing) and results of real measurements.
211+
212+ Datasheet SHT20 Table 7: timing versus results of real measurements.
191213( https://github.com/RobTillaart/SHT2x/pull/11 )
192214
193215| RES | HUM | TEMP | TOTAL | REAL |
@@ -209,44 +231,45 @@ Timing in milliseconds.
209231## Future
210232
211233#### Must
234+
212235- improve documentation
213236 - reorganize interface
237+ - async documentation
214238- clean up code.
215239
216-
217240#### 0.4.0
241+
218242- add crc8 check (need sensor to test)
219243- improve error handling (all code paths)
220244- investigate blocking delay() in read
221245- add offset for temperature and humidity
222246
223-
224- #### ASYNC 0.4.0
225- improvements for interface.
226-
227- - ** bool requestReady()** checks both.
228- - ** bool requestPending()** checks.
229- - ** uint8_t getRequestType()** returns 0, 1, 2.
230- - async documentation
231-
232-
233247#### Should
248+
234249- test test test
235250 - get hardware
236251- add examples
237252 - test resolutions
238253 - performance different resolutions
239254 - test battery
240255
241-
242256#### Could
257+
243258- fix TODO in code (.cpp and .h) and documentation
244259- update unit tests
245260- add type info in derived classes?
246261
247-
248262#### Wont
249263
250264- add ** getSerialNumber()**
251265 ** getEIDA()** and ** getEIDB()** covers this
252266
267+
268+ ## Support
269+
270+ If you appreciate my libraries, you can support the development and maintenance.
271+ Improve the quality of the libraries by providing issues and Pull Requests, or
272+ donate through PayPal or GitHub sponsors.
273+
274+ Thank you,
275+
0 commit comments