sht30+rak811 loraWAN+ 2threads
Dependents: mbed-os-example_2threads_RAK811
Diff: Sht31.cpp
- Revision:
- 3:861437b6816f
- Parent:
- 2:c84a60326ecf
diff -r c84a60326ecf -r 861437b6816f Sht31.cpp --- a/Sht31.cpp Mon Sep 11 13:51:03 2017 +0000 +++ b/Sht31.cpp Thu Mar 03 12:08:01 2022 +0000 @@ -18,7 +18,7 @@ #include "mbed.h" Sht31::Sht31(PinName sda, PinName scl) : _i2c(sda, scl) { - _i2caddr = (0x44 << 1); + _i2caddr = (0x45 << 1); reset(); readStatus(); } @@ -35,7 +35,7 @@ void Sht31::reset(void) { writeCommand(SHT31_SOFTRESET); - wait_ms(10); + ThisThread::sleep_for(10); } uint16_t Sht31::readStatus(void) { @@ -62,7 +62,7 @@ writeCommand(SHT31_MEAS_HIGHREP); - wait_ms(500); + ThisThread::sleep_for(500); _i2c.read(_i2caddr, readbuffer, 6); uint16_t ST, SRH;