library HTU21D results in float

Dependents:   HTU21D_HELLOWORLD Major_dHome

Fork of HTU21D by Alex Lipford

Revision:
3:b2ef34462ac2
Parent:
2:4fd07be6bad8
--- a/HTU21D/HTU21D.cpp	Sun Oct 19 19:27:19 2014 +0000
+++ b/HTU21D/HTU21D.cpp	Tue Mar 31 15:19:15 2015 +0000
@@ -38,7 +38,7 @@
 
 }
 
-int HTU21D::sample_ctemp(void) {
+float HTU21D::sample_ctemp(void) {
 
     char tx[1];
     char rx[2];
@@ -58,27 +58,27 @@
     float tempTemperature = rawTemperature / (float)65536; //2^16 = 65536
     float realTemperature = -46.85 + (175.72 * tempTemperature); //From page 14
 
-    return (int)realTemperature;
+    return (float)realTemperature;
 
 }
 
-int HTU21D::sample_ftemp(void){
-    int temptemp = sample_ctemp();
-    int ftemp = temptemp * 1.8 + 32;
+float HTU21D::sample_ftemp(void){
+    float temptemp = sample_ctemp();
+    float ftemp = temptemp * 1.8 + 32;
     
     return ftemp;
 }
 
-int HTU21D::sample_ktemp(void){
-    int temptemp = sample_ctemp();
-    int ktemp = temptemp + 274;
+float HTU21D::sample_ktemp(void){
+    float temptemp = sample_ctemp();
+    float ktemp = temptemp + 274;
     
     return ktemp;
     
     
 }
 
-int HTU21D::sample_humid(void) {
+float HTU21D::sample_humid(void) {
 
     char tx[1];
     char rx[2];
@@ -102,7 +102,7 @@
     float rh = -6 + (125 * tempRH); //From page 14
 
 
-    return (int)rh;
+    return (float)rh;
 
 }