Closed FBMinis closed 1 year ago
Thanks for using this library. Just some suggestions:
volatile
keyword for variables shared between the main loop and interrupt handler?Please notice that the scope of helping with issues is limited to this ErriezBMX280 library and maintain this in spare time. Integration with libraries can influence the behavior and I can only provide some suggestions.
Success!
Do I need to change the sampling and mode of operation if I used the sensor outside, compared to the values in the example?
Thank you
The sampling mode of operation is handled inside the sensor hardware and configures the accuracy of the sensor values. The library contains an interface setSampling()
for setting this mode.
The commented weather
mode is recommended for outdoor which is less accurate (sufficient for weather conditions) and is also for low-power battery devices. In your posted example, the highest accuracy with highest power consumption is specified and probably not required for your application, but up to you.
A second mode is important and configured correctly once at startup in setup()
:
BMX280_MODE_SLEEP
: Very low power, no conversion, requires forced trigger before reading sensor values.BMX280_MODE_NORMAL
: Continues conversion by hardware, no wait to read latest sensor values. (Selected in your example)BMX280_MODE_FORCED
: Single forced conversion, requires minimum 1000ms wait time before sensor values can be read (application responsibility).For more modes of operation information, please refer to section 3.5 Recommended modes of operation.
Thank you very much for your time to help me and for your libraries :)
You're welcome. I'll close this issue.
First of all, thank your very much for sharing your work.
I would like to return the values from the BME280 when I issue a command in a Telegram chat. I am not sure if I need to update those values every 1 second in the loop() function, then send them to me when I issued the command. I tried capturing the values from the sensor only when the command is issued but after leaving the module unattended for some minutes, the values were not correct anymore (like 623.39 hPa instead of 1020.71 hPa).
My project is comprised of a Wemos D1, a PIR and a BME238 sensor, powered by USB. The PIR triggers and interrupt and a message is sent to a Telegram channel; the BME238 captures temperature, humidity, pressure and altitude and these values are sent to me when I type "/status". It is a basic surveillance/weather station that is placed in my backyard. My only doubt is how to correctly retrieve the values from the BME238.
I would appreciate your feedback on how to improve my code : )