janw-cz / JWA_BME280

Arduino library for BME280 sensor based on reference driver
15 stars 9 forks source link

Replace delay in measure for faster response time. #6

Closed h2zero closed 3 years ago

h2zero commented 5 years ago

Got the method for this from the adafruit library.

Instead of delaying for 255ms this will return as soon as a new measurement is ready to read.

In my testing this takes only 26ms on average instead of waiting 255ms.

Edit: Updated the code to prevent possible endless loop and included SPI usage, also reduced the read time to ~18ms in my testing.