Skip to content

Commit

Permalink
Issue hybridgroup#424: Enables humidity readings in the BME280 driver…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
ssorc committed May 31, 2017
1 parent 9df6714 commit 6ad6aeb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/i2c/bme280_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
)

const bme280RegisterControlHumidity = 0xF2
const bme280RegisterControl = 0xf4
const bme280RegisterHumidityMSB = 0xFD
const bme280RegisterCalibDigH1 = 0xa1
const bme280RegisterCalibDigH2LSB = 0xe1
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 6ad6aeb

Please sign in to comment.