Skip to content
This repository was archived by the owner on May 27, 2020. It is now read-only.

Commit f9109c2

Browse files
author
Toni Klopfenstein
committed
Merge branch 'ms-iot-master'
2 parents 8a1befe + 101134a commit f9109c2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

library/HTU21D_Humidity/HTU21D.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ HTU21D::HTU21D()
3535
//Begin
3636
/*******************************************************************************************/
3737
//Start I2C communication
38-
bool HTU21D::begin(void)
38+
void HTU21D::begin(void)
3939
{
4040
Wire.begin();
4141
}
@@ -139,7 +139,7 @@ float HTU21D::readTemperature(void)
139139

140140
//Given the raw temperature data, calculate the actual temperature
141141
float tempTemperature = rawTemperature / (float)65536; //2^16 = 65536
142-
float realTemperature = -46.85 + (175.72 * tempTemperature); //From page 14
142+
float realTemperature = (float)(-46.85 + (175.72 * tempTemperature)); //From page 14
143143

144144
return(realTemperature);
145145
}
@@ -157,8 +157,8 @@ float HTU21D::readTemperature(void)
157157
void HTU21D::setResolution(byte resolution)
158158
{
159159
byte userRegister = read_user_register(); //Go get the current register state
160-
userRegister &= 0b01111110; //Turn off the resolution bits
161-
resolution &= 0b10000001; //Turn off all other bits but resolution bits
160+
userRegister &= B01111110; //Turn off the resolution bits
161+
resolution &= B10000001; //Turn off all other bits but resolution bits
162162
userRegister |= resolution; //Mask in the requested resolution bits
163163

164164
//Request a write to user register

library/HTU21D_Humidity/HTU21D.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class HTU21D {
3434
HTU21D();
3535

3636
//Public Functions
37-
bool begin();
37+
void begin();
3838
float readHumidity(void);
3939
float readTemperature(void);
4040
void setResolution(byte resBits);

0 commit comments

Comments
 (0)