You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
5.4.6 Register 0xF5 "config"
The "config" register sets the rate, filter and interface options of the device. Writes to the "config" register in normal mode may be ignored. In sleep mode writes are not ignored.
Since at the end of the begin call, the mode is set to normal. Calls to setStandbyTime or setFilter may be ignored. It should also be noted about the sensor mode transitions,
3.3.1 Sensor mode transitions
If the device is currently performing a measurement, the execution of mode switching commands is delayed until the end of the currently running measurement period.
These two functions should check the current mode, if it is not in sleep mode, change to sleep mode, make the change and return to the original mode. If the device is currently measuring, it should wait until the measurement is complete before setting the values.
It is unclear in the data sheet, if in forced mode if the writes would be ignored or not. In forced mode, once the measurement is complete, the mode transitions back to sleep automatically.
The error is easy for someone to come across, for example Issue 27, the person calls begin and subsequently calls setStandbyTime andsetFilter.
I can also see setTempOverSample, setPressureOverSample and setHumidityOverSample use this get mode, set mode to sleep, change setting and set mode to original pattern. I was not able to find anything in the data sheet about requiring sleep mode for the over sample settings to take effect. The temperature and pressure settings use the same ctrl_meas register which is shared with the mode. The humidity oversampling does not take effect util a write to ctrl_meas, but it does not state the device needs to be in sleep mode.
The text was updated successfully, but these errors were encountered:
While I agree that the automated functionality would be useful for novice users; I would argue that these are more advanced functions of the library and users should be referring to the datasheet and source code when using them. Currently, my hesitation is that it makes the code "repetitive" for advanced users.
With the proposed modifications, changing 2 settings would require 10 transactions.
(1) Checking the "current mode".
(2) Changing to sleep mode.
(3-4) Adjusting the settings (2 transactions).
(5) Changing back to the "current mode".
(6-10) Repeat steps.
Whereas, with the current library, it is completed in 6 transactions
(1) Changing to sleep mode.
(2-5) Adjusting the 2 settings (4 transactions).
(6) Changing to the preferred mode.
While the proposed changes shouldn't cause backwards compatibility issues, it does create a situation where other customers' code would now compile with redundant sleep mode transactions as well.
Would timing delay of added transactions be an issue?
Notes:
I could add comments in the source code and hookup guides for users.
Example4.ino probably needs to be updated for this issue. Test to confirm.
The the Bosch BME280 data sheet state,
Since at the end of the
begin
call, the mode is set to normal. Calls tosetStandbyTime
orsetFilter
may be ignored. It should also be noted about the sensor mode transitions,These two functions should check the current mode, if it is not in sleep mode, change to sleep mode, make the change and return to the original mode. If the device is currently measuring, it should wait until the measurement is complete before setting the values.
It is unclear in the data sheet, if in forced mode if the writes would be ignored or not. In forced mode, once the measurement is complete, the mode transitions back to sleep automatically.
The error is easy for someone to come across, for example Issue 27, the person calls begin and subsequently calls
setStandbyTime
andsetFilter
.I can also see
setTempOverSample
,setPressureOverSample
andsetHumidityOverSample
use this get mode, set mode to sleep, change setting and set mode to original pattern. I was not able to find anything in the data sheet about requiring sleep mode for the over sample settings to take effect. The temperature and pressure settings use the same ctrl_meas register which is shared with the mode. The humidity oversampling does not take effect util a write to ctrl_meas, but it does not state the device needs to be in sleep mode.The text was updated successfully, but these errors were encountered: