hello

Dependents:   sht31_II ina-hack-test rapidtouchscreenprototype EMBEDDED_SYSTEM_PROJECT_GROUP_9 ... more

Files at this revision

API Documentation at this revision

Comitter:
GeofferyOmlette
Date:
Thu Jul 21 15:31:08 2016 +0000
Parent:
0:c90aa4f69539
Commit message:
hello

Changed in this revision

Sht31.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r c90aa4f69539 -r 756e26f0b067 Sht31.cpp
--- a/Sht31.cpp	Wed Jul 20 16:51:28 2016 +0000
+++ b/Sht31.cpp	Thu Jul 21 15:31:08 2016 +0000
@@ -19,7 +19,7 @@
 
 Sht31::Sht31(PinName sda, PinName scl) : _i2c(sda, scl) {
     _i2caddr = 0x44;
-     printf("\r\n");
+    printf("\r\n");
     reset();
     readStatus();
 }
@@ -35,9 +35,7 @@
 }
 
 void Sht31::reset(void) {
-    _i2c.start();
-    _i2c.write(SHT31_SOFTRESET);
-    _i2c.stop();
+    writeCommand(SHT31_SOFTRESET);
     wait_ms(10);
 }
 
@@ -66,7 +64,6 @@
     _i2c.stop();
 }
 
-
 bool Sht31::readTempHum(void) {
     char readbuffer[6];
 
@@ -76,9 +73,9 @@
     _i2c.start();
     _i2c.read(_i2caddr, readbuffer, 6);
     _i2c.stop();
-     for (uint8_t i = 0; i < 6; i++) {
-         printf("0x%Xd\r\n", readbuffer[i]);
-     }
+    for (uint8_t i = 0; i < 6; i++) {
+        printf("0x%Xd\r\n", readbuffer[i]);
+    }
     uint16_t ST, SRH;
     ST = readbuffer[0];
     ST <<= 8;