Sht31 LIB for TY51822r3

Dependents:   ina-hack-2nd

Fork of Sht31 by Robert Taylor

Files at this revision

API Documentation at this revision

Comitter:
sonson
Date:
Tue Aug 22 02:44:41 2017 +0000
Parent:
2:6881f251be5e
Commit message:
TY51822r3????

Changed in this revision

DS2482.lib Show diff for this revision Revisions of this file
Sht31.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 6881f251be5e -r 97593ea1eff5 DS2482.lib
--- a/DS2482.lib	Wed Aug 09 06:01:09 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-https://mbed.org/users/rs27/code/DS2482/#d94037eb31ed
diff -r 6881f251be5e -r 97593ea1eff5 Sht31.cpp
--- a/Sht31.cpp	Wed Aug 09 06:01:09 2017 +0000
+++ b/Sht31.cpp	Tue Aug 22 02:44:41 2017 +0000
@@ -18,7 +18,7 @@
 #include "mbed.h"
 
 Sht31::Sht31(PinName sda, PinName scl) : _i2c(sda, scl) {
-    _i2caddr = 0x44;
+    _i2caddr = 0x44*2;
     printf("\r\n");
     reset();
     readStatus();
@@ -67,7 +67,8 @@
 bool Sht31::readTempHum(void) {
     char readbuffer[6];
 
-    writeCommand(SHT31_MEAS_HIGHREP);
+//    writeCommand(SHT31_MEAS_HIGHREP);
+    writeCommand(0x2721);
 
     wait_ms(500);
     _i2c.start();