Humidity and Temperature Sensor - Sensirion SHT1x driver

Dependents:   lpc4088Sensor

Fork of SHTx by Roy van Dam

Files at this revision

API Documentation at this revision

Comitter:
BPPearson
Date:
Fri May 06 10:17:08 2016 +0000
Parent:
1:8465801be23f
Commit message:
First revision - Melbourne specifics

Changed in this revision

sht15.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 8465801be23f -r 189a7d9ddc40 sht15.cpp
--- a/sht15.cpp	Fri Nov 19 16:24:46 2010 +0000
+++ b/sht15.cpp	Fri May 06 10:17:08 2016 +0000
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2010 Roy van Dam <roy@negative-black.org>
  * All rights reserved.
  *
@@ -28,7 +28,7 @@
 
 namespace SHTx {    
     SHT15::SHT15(PinName sda, PinName scl): i2c(sda, scl) {        
-        this->ready = true;
+        //this->ready = true;
         wait_ms(11);
     }
 
@@ -81,7 +81,7 @@
 
     bool
     SHT15::update(void) {
-        if ((this->ready == false) ||
+        if (//(this->ready == false) ||
             !this->readRegister(cmd_read_temperature) ||
             !this->readRegister(cmd_read_humidity)) {
             return false;
@@ -92,15 +92,15 @@
 
     bool
     SHT15::reset(void) {
-        while (this->ready == false) {
-            continue;
-        }
+//        while (this->ready == false) {
+//            continue;
+//        }
     
-        this->ready = false;    
+//        this->ready = false;    
         this->i2c.start();
         bool ack = this->i2c.write(cmd_reset_device);
         this->i2c.stop();
-        this->ready = true;
+//        this->ready = true;
     
         if (ack) {
             this->status_register = 0;
@@ -152,11 +152,11 @@
 
     bool
     SHT15::writeRegister(void) {
-        while (this->ready == false) {
-            continue;
-        }
+//        while (this->ready == false) {
+//            continue;
+//        }
     
-        this->ready = false;    
+//        this->ready = false;    
         this->i2c.start();
 
         if (this->i2c.write(cmd_write_register)) {
@@ -164,18 +164,18 @@
         }
 
         this->i2c.stop();
-        this->ready = true;
+//        this->ready = true;
 
         return true;
     }
 
     bool
     SHT15::readRegister(cmd_list command) {
-        while (this->ready == false) {
-            continue;
-        }
+//        while (this->ready == false) {
+//            continue;
+//        }
     
-        this->ready = false;
+//        this->ready = false;
         this->i2c.start();
     
         if (!this->i2c.write(command)) {
@@ -210,7 +210,7 @@
         }
     
         this->i2c.stop();
-        this->ready = true;
+//        this->ready = true;
     
         return true;
     }