Skip to content

Commit

Permalink
bmp280 reads at the right frequency.
Browse files Browse the repository at this point in the history
  • Loading branch information
westphae committed Feb 8, 2017
1 parent 5e0f586 commit ecd0ed5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sensors/bmp280.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ func NewBMP280(i2cbus *embd.I2CBus, freq time.Duration) (*BMP280, error) {

func (bmp *BMP280) run() {
bmp.running = true
clock := time.NewTicker(100 * time.Millisecond)
for bmp.running {
<-clock.C
bmp.data = <-bmp.sensor.C
}
}
Expand Down

0 comments on commit ecd0ed5

Please sign in to comment.