diff --git a/samples/l3gd20.go b/samples/l3gd20.go index c938c47..3576f63 100644 --- a/samples/l3gd20.go +++ b/samples/l3gd20.go @@ -15,6 +15,7 @@ func main() { log.Panic(err) } gyro := l3gd20.New(bus, l3gd20.R250DPS) + gyro.Poll = 50 defer gyro.Close() gyro.Start() diff --git a/sensor/l3gd20/l3gd20.go b/sensor/l3gd20/l3gd20.go index 080785a..0ce1abd 100644 --- a/sensor/l3gd20/l3gd20.go +++ b/sensor/l3gd20/l3gd20.go @@ -358,6 +358,7 @@ func (d *L3GD20) Start() (err error) { } oldTime = currTime case orientations <- Orientation{x, y, z}: + orientations = nil case waitc := <-d.closing: waitc <- struct{}{} close(d.orientations)