It may happen that the conversion was not started yet when the
first check for conversion done is done. Then the sensor returns
the previous values. The change adds a short wait until the
conversion is started. The longest wait time is about 5 ms.
Side change: Fix the error message for a wrong oversample argument.
Signed-off-by: robert-hh <robert@hammelrath.com>
Set the mode on init, like the float version does. Since the mode
is set again before reading, that shoud not change much.
Signed-off-by: robert-hh <robert@hammelrath.com>
The license situation is a little bit fuzzy, since the actual code
state is based on various sources at different times. The most
common license statements in these sources use MIT wording, even if is
not explicitely referenced. So I keep it like that.
Instead of just waiting a safe time, check the status register
for completion of the measurement. The drawback is a slightly
increased power consumption.
Initial commit. Files:
bme280_int.py: Driver using integer arithmetic for compensation
bme280_float.py: Driver using floating point arithmetic for compensation
README.md: Documentation
bmetest.py: Sample test code.