This repository was archived by the owner on May 27, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff 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)
157157void 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
Original file line number Diff line number Diff 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);
You can’t perform that action at this time.
0 commit comments