File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -102,8 +102,11 @@ uint8_t BME280::begin()
102102 break ;
103103 }
104104
105+ // Check communication with IC before anything else
106+ uint8_t chipID = readRegister (BME280_CHIP_ID_REG); // Should return 0x60
107+ if (chipID != 0x60 ) return (chipID); // Failed!
108+
105109 // Reading all compensation data, range 0x88:A1, 0xE1:E7
106-
107110 calibration.dig_T1 = ((uint16_t )((readRegister (BME280_DIG_T1_MSB_REG) << 8 ) + readRegister (BME280_DIG_T1_LSB_REG)));
108111 calibration.dig_T2 = ((int16_t )((readRegister (BME280_DIG_T2_MSB_REG) << 8 ) + readRegister (BME280_DIG_T2_LSB_REG)));
109112 calibration.dig_T3 = ((int16_t )((readRegister (BME280_DIG_T3_MSB_REG) << 8 ) + readRegister (BME280_DIG_T3_LSB_REG)));
@@ -305,7 +308,7 @@ float BME280::readFloatPressure( void )
305308// Sets the internal variable _referencePressure so the
306309void BME280::setReferencePressure (float refPressure)
307310{
308- _referencePressure = rePressure ;
311+ _referencePressure = refPressure ;
309312}
310313
311314// Return the local reference pressure
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ struct SensorCalibration
141141 uint8_t dig_H3;
142142 int16_t dig_H4;
143143 int16_t dig_H5;
144- uint8_t dig_H6;
144+ int8_t dig_H6;
145145
146146};
147147
You can’t perform that action at this time.
0 commit comments