Changed hts221 into Class.

Dependents:   WeatherSensor-Joe PAG-CourseWork-NicksEdits SOFT253_Assignment SOFT253_Assignment_V2 ... more

Fork of hts221 by Kyle Rodgers

Revision:
2:6d7166d49741
Parent:
1:da79e74eadd1
--- a/hts221.cpp	Fri Jul 24 15:21:28 2015 +0000
+++ b/hts221.cpp	Wed Feb 10 19:13:37 2016 +0000
@@ -136,4 +136,19 @@
    float b = (float) -a*x0 + y0;
    float cal = (float) a * mes + b;
    return cal;
+}
+void HTS221::powerMode(PowerMode mode)
+{
+    char reg;
+    
+    register_read(0x20, &reg, 1);
+
+    //Set or clear the SHUTDOWN bit
+    if (mode == POWER_SHUTDOWN) 
+        reg &= ~(PD_On);
+    else
+        reg |= PD_On;
+    
+    register_write(0x20 , reg); // Control register 1);
+
 }
\ No newline at end of file