mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-08 00:43:39 +00:00
mma8653: return acceleration in a standard unit: micro-G.
This commit is contained in:
committed by
Ron Evans
parent
c83475d09d
commit
b0c4f3e2ce
@@ -12,10 +12,10 @@ func main() {
|
||||
machine.I2C0.Configure(machine.I2CConfig{})
|
||||
|
||||
accel := mma8653.New(machine.I2C0)
|
||||
accel.Configure(mma8653.DataRate200Hz)
|
||||
accel.Configure(mma8653.DataRate200Hz, mma8653.Sensitivity2G)
|
||||
|
||||
for {
|
||||
x, y, z := accel.ReadAcceleration()
|
||||
x, y, z, _ := accel.ReadAcceleration()
|
||||
println(x, y, z)
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user