Javascript wrappers for HTS221 Sensor library

Dependencies:   HTS221

Dependents:   ST_SENSOR_JS

Revision:
3:df24cbc8aaf0
Parent:
1:924fb53eb7f8
Child:
4:6043b9511072
--- a/HTS221_JS.cpp	Thu Oct 12 11:12:41 2017 +0200
+++ b/HTS221_JS.cpp	Mon Oct 23 16:38:37 2017 +0200
@@ -68,10 +68,10 @@
 
 	/* fill in leading fractional zeros */
 	for (i/=10;i>1; i/=10, ptr++) {
-	if (fractPart >= i) {
-		break;
-	}
-	*ptr = '0';
+		if (fractPart >= i) {
+			break;
+		}
+		*ptr = '0';
 	}
 
 	/* fill in (rest of) fractional part */
@@ -86,8 +86,8 @@
  * @brief     Initializing the component.
  * @param i2c object of an helper class which handles the I2C peripheral
  */
-HTS221_JS::HTS221_JS(DevI2C &i2c){
-	hum_temp = new HTS221Sensor(&i2c);
+HTS221_JS::HTS221_JS(I2C &i2c){
+	hum_temp = new HTS221Sensor(reinterpret_cast<DevI2C*>(&i2c));
 	hum_temp->init(NULL);
 	hum_temp->enable();
 }