mirror of
https://github.com/hybridgroup/gobot.git
synced 2025-04-29 13:49:14 +08:00
Issue #424: Enables humidity readings in the BME280 driver by enforcing the write to the 'ctrl_meas' register, as per Section 5.4.3 of the BME280 data sheet
Signed-off-by: Graeme Cross <graeme@ceriumdesigns.com>
This commit is contained in:
parent
dcd861ed6e
commit
18cfa16cc7
@ -7,6 +7,7 @@ import (
|
||||
)
|
||||
|
||||
const bme280RegisterControlHumidity = 0xF2
|
||||
const bme280RegisterControl = 0xf4
|
||||
const bme280RegisterHumidityMSB = 0xFD
|
||||
const bme280RegisterCalibDigH1 = 0xa1
|
||||
const bme280RegisterCalibDigH2LSB = 0xe1
|
||||
@ -113,6 +114,7 @@ func (d *BME280Driver) initHumidity() (err error) {
|
||||
d.hc.h5 = 0 + (int16(addrE6) << 4) | (int16(addrE5) >> 4)
|
||||
|
||||
d.connection.WriteByteData(bme280RegisterControlHumidity, 0x3F)
|
||||
d.connection.WriteByteData(bmp280RegisterControl, 0x3F)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user