kopia lustrzana https://github.com/cyoung/stratux
fixed missing config
rodzic
319878b746
commit
95188181c5
|
@ -28,7 +28,12 @@ func NewBMP388(i2cbus *embd.I2CBus) (*BMP388, error) {
|
|||
if !connected {
|
||||
return nil, bmp388.ErrNotConnected
|
||||
}
|
||||
err := bmp.Configure(bmp.Config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
newBmp := BMP388{sensor: &bmp}
|
||||
|
||||
go newBmp.run()
|
||||
return &newBmp, nil
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ func main() {
|
|||
clock := time.NewTicker(time.Millisecond)
|
||||
for {
|
||||
for _ = range clock.C {
|
||||
|
||||
p, _ := bmp.ReadPressure()
|
||||
t, _ := bmp.ReadTemperature()
|
||||
fmt.Printf("%3.2f,%4.2f\n", p, t)
|
||||
|
|
Ładowanie…
Reference in New Issue