Humidity and Temperature Sensor - Sensirion SHT1x driver (with exported functions to use it from C code)

Dependents:   sht15_remote_monitoring

Fork of SHTx by Roy van Dam

Revision:
2:7505a67001b4
Parent:
1:8465801be23f
--- a/sht15.cpp	Fri Nov 19 16:24:46 2010 +0000
+++ b/sht15.cpp	Sun Nov 15 15:13:08 2015 +0000
@@ -229,3 +229,39 @@
         }
     }
 }
+
+SHTx::SHT15 sensor(PTE25, PTE24);
+
+extern "C" void SHT15_init(void) {
+
+	// Speed things up a bit.
+    sensor.setOTPReload(false);
+    sensor.setResolution(true);
+    
+    // Temperature in celcius
+    sensor.setScale(false);
+
+	return;
+}
+
+extern "C" void SHT15_update(void) {
+
+	sensor.update();
+	return;
+}
+
+extern "C" float SHT15_getTemperature(void) {
+	
+	// Temperature
+	return sensor.getTemperature();
+}
+
+extern "C" float SHT15_getHumidity(void) {
+	
+	// Relative Humidity
+	return sensor.getHumidity();
+}
+
+extern "C" void SHT15_setScale(bool value) {
+	sensor.setScale(value);
+}
\ No newline at end of file