sht30+rak811 loraWAN+ 2threads

Dependents:   mbed-os-example_2threads_RAK811

Files at this revision

API Documentation at this revision

Comitter:
awali
Date:
Thu Mar 03 12:08:01 2022 +0000
Parent:
2:c84a60326ecf
Commit message:
1

Changed in this revision

Sht31.cpp Show annotated file Show diff for this revision Revisions of this file
Sht31.h Show annotated file Show diff for this revision Revisions of this file
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;
diff -r c84a60326ecf -r 861437b6816f Sht31.h
--- a/Sht31.h	Mon Sep 11 13:51:03 2017 +0000
+++ b/Sht31.h	Thu Mar 03 12:08:01 2022 +0000
@@ -19,7 +19,7 @@
 
 #include "mbed.h"
 
-#define SHT31_DEFAULT_ADDR          0x44
+#define SHT31_DEFAULT_ADDR          0x45
 #define SHT31_MEAS_HIGHREP_STRETCH  0x2C06
 #define SHT31_MEAS_MEDREP_STRETCH   0x2C0D
 #define SHT31_MEAS_LOWREP_STRETCH   0x2C10