Skip to content

Commit 4ffb889

Browse files
committed
0.5.3 SHT2x
1 parent cde49e7 commit 4ffb889

File tree

8 files changed

+21
-5
lines changed

8 files changed

+21
-5
lines changed

libraries/SHT2x/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

88

9+
## [0.5.3] - 2025-06-19
10+
- Fix #37, update README to wait before first command (kudos to pdaoust)
11+
- add delay in async demos to wait for sensor to be ready
12+
- fix version number
13+
- minor edits
14+
915
## [0.5.2] - 2025-06-14
1016
- PR #34 - revert status checking
1117
- improve some error handling

libraries/SHT2x/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,12 @@ void loop() {
217217
}
218218
```
219219

220+
**Waiting until the device is ready:**
221+
222+
These sensors typically need a bit of time to start up before they can accept commands. The SHT21, for instance, requires up to 15ms after it's been powered up. In many programs, the delay that the Arduino framework introduces between your `setup()` and `loop()` functions is sufficient, but if you intend to request your first reading in `setup()` immediately after calling `begin()`, the request may fail. If `requestTemperature()` or `requestHumidity()` returns false and the error code returned from `getError()` is `0x81` (`SHT2x_ERR_WRITECMD`), this may be a sign that the sensor isn't ready.
223+
224+
To work around this, introduce a short delay after calling `begin()` and before requesting a reading. 15ms is probably more than sufficient, although this hasn't been tested extensively.
225+
220226
#### Heater Functions
221227

222228
The built-in heater can be used to test the sensor or to drive off condensation.

libraries/SHT2x/SHT2x.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// FILE: SHT2x.cpp
33
// AUTHOR: Rob Tillaart, Viktor Balint, JensB, morfeus02
4-
// VERSION: 0.5.2
4+
// VERSION: 0.5.3
55
// DATE: 2023-11-25
66
// PURPOSE: Arduino library for the SHT2x temperature and humidity sensor
77
// URL: https://github.com/RobTillaart/SHT2x

libraries/SHT2x/SHT2x.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// FILE: SHT2x.h
44
// AUTHOR: Rob Tillaart, Viktor Balint, JensB, morfeus02
5-
// VERSION: 0.5.1
5+
// VERSION: 0.5.3
66
// DATE: 2023-11-25
77
// PURPOSE: Arduino library for the SHT2x temperature and humidity sensor
88
// URL: https://github.com/RobTillaart/SHT2x
@@ -13,7 +13,7 @@
1313
#include "Wire.h"
1414

1515

16-
#define SHT2x_LIB_VERSION (F("0.5.1"))
16+
#define SHT2x_LIB_VERSION (F("0.5.3"))
1717

1818

1919
// fields getStatus

libraries/SHT2x/examples/SHT2x_demo_async/SHT2x_demo_async.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ void setup()
2727
Serial.print(stat, HEX);
2828
Serial.println();
2929

30+
// Wait for the sensor to be ready to start accepting commands.
31+
delay(15);
3032
sht.requestTemperature();
3133
}
3234

libraries/SHT2x/examples/SHT2x_demo_async_HT/SHT2x_demo_async_HT.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ void setup()
3636
Serial.print(stat, HEX);
3737
Serial.println();
3838

39+
// Wait for the sensor to be ready to start accepting commands.
40+
delay(15);
3941
sht.requestTemperature();
4042
}
4143

libraries/SHT2x/library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"type": "git",
2525
"url": "https://github.com/RobTillaart/SHT2x.git"
2626
},
27-
"version": "0.5.2",
27+
"version": "0.5.3",
2828
"license": "MIT",
2929
"frameworks": "*",
3030
"platforms": "*",

libraries/SHT2x/library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SHT2x
2-
version=0.5.2
2+
version=0.5.3
33
author=Rob Tillaart <[email protected]>
44
maintainer=Rob Tillaart <[email protected]>
55
sentence=Arduino library for the I2C SHT20 SHT21 SHT25 series temperature and humidity sensor.

0 commit comments

Comments
 (0)