Skip to content

Commit c005887

Browse files
author
Fabiano Riccardi
committed
After a brief reading of the datasheet of sht3x, useless delays were removed
Signed-off-by: Fabiano Riccardi <fabiuz4@hotmail.it>
1 parent 08ed0e7 commit c005887

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/WEMOS_SHT3X.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ byte SHT3X::get()
2424
if (Wire.endTransmission()!=0)
2525
return 1;
2626

27-
delay(500);
27+
// From the datasheet, this is the max time needed to read
28+
// temp and hum at "high repeability" mode
29+
delay(15);
2830

2931
// Request 6 bytes of data
3032
Wire.requestFrom(_address, 6);
@@ -35,8 +37,8 @@ byte SHT3X::get()
3537
data[i]=Wire.read();
3638
};
3739

38-
delay(50);
39-
40+
// No need to wait again, the last "bit" (NACK) has been already received
41+
4042
if (Wire.available()!=0)
4143
return 2;
4244

0 commit comments

Comments
 (0)