Skip to content

Commit 2ec5b71

Browse files
authored
Add clear status method (#42)
1 parent a596fee commit 2ec5b71

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

SHT31.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,15 @@ uint16_t SHT31::readStatus()
131131
return (uint16_t) (status[0] << 8) + status[1];
132132
}
133133

134+
bool SHT31::clearStatus()
135+
{
136+
if (writeCmd(SHT31_CLEAR_STATUS) == false)
137+
{
138+
return false;
139+
}
140+
_lastRequest = millis();
141+
return true;
142+
}
134143

135144
bool SHT31::reset(bool hard)
136145
{

SHT31.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class SHT31
5757

5858
// details see datasheet; summary in SHT31.cpp file
5959
uint16_t readStatus();
60+
bool clearStatus();
6061

6162
// lastRead is in milliSeconds since start
6263
uint32_t lastRead() { return _lastRead; };

0 commit comments

Comments
 (0)