mirror of
https://github.com/kidoman/embd
synced 2024-12-22 12:50:19 +01:00
l3gd20: sends data as often as we get it from the sensor
This commit is contained in:
parent
b96018021e
commit
d1e0e00ff7
@ -15,6 +15,7 @@ func main() {
|
|||||||
log.Panic(err)
|
log.Panic(err)
|
||||||
}
|
}
|
||||||
gyro := l3gd20.New(bus, l3gd20.R250DPS)
|
gyro := l3gd20.New(bus, l3gd20.R250DPS)
|
||||||
|
gyro.Poll = 50
|
||||||
defer gyro.Close()
|
defer gyro.Close()
|
||||||
|
|
||||||
gyro.Start()
|
gyro.Start()
|
||||||
|
@ -358,6 +358,7 @@ func (d *L3GD20) Start() (err error) {
|
|||||||
}
|
}
|
||||||
oldTime = currTime
|
oldTime = currTime
|
||||||
case orientations <- Orientation{x, y, z}:
|
case orientations <- Orientation{x, y, z}:
|
||||||
|
orientations = nil
|
||||||
case waitc := <-d.closing:
|
case waitc := <-d.closing:
|
||||||
waitc <- struct{}{}
|
waitc <- struct{}{}
|
||||||
close(d.orientations)
|
close(d.orientations)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user