adafruit / Adafruit_BMP280_Library

Arduino Library for BMP280 sensors
250 stars 187 forks source link

Implement getStatus() and reset() #33

Closed buzz-tee closed 4 years ago

buzz-tee commented 4 years ago

After my sensor got disconnected and reconnected the reading was no longer correct. To figure out when this happens I added the getStatus() function. When such an event occurred calling reset() would bring the reading back reliably.

I tested my code on an ESP32 using I2C. Whenever getStatus() reports 0xFF the sensor starts sending valid data again after calling reset(). It appears also begin() needs to be called on the sensor.

I did not test using SPI.

HollisTech commented 4 years ago

Please please please merge this PR. Reading the data without first checking the status bit 0x08 is just wrong. And thanks BastiG!

HollisTech commented 4 years ago

ugh, platformio needs the version bumped too. And thanks!