Javascript wrappers for LPS22HB Sensor library
Dependencies: LPS22HB
Diff: LPS22HB_JS.cpp
- Revision:
- 3:3e19d8808491
- Parent:
- 1:6b7b798e36ae
- Child:
- 4:c2cf5deba40f
--- a/LPS22HB_JS.cpp Thu Oct 12 11:11:59 2017 +0200 +++ b/LPS22HB_JS.cpp Mon Oct 23 16:40:42 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 */ -LPS22HB_JS::LPS22HB_JS(DevI2C &i2c){ - press_temp = new LPS22HBSensor(&i2c); +LPS22HB_JS::LPS22HB_JS(I2C &i2c){ + press_temp = new LPS22HBSensor(reinterpret_cast<DevI2C*>(&i2c)); press_temp->init(NULL); press_temp->enable(); }