adxl345: update ADXL345 driver and example to make uniform with other accelerometers

Signed-off-by: Ron Evans <ron@hybridgroup.com>
This commit is contained in:
Ron Evans
2019-04-26 20:07:36 +02:00
committed by Ayke van Laethem
parent b7fe897b8c
commit 8ac1fa2b22
2 changed files with 34 additions and 31 deletions
+2 -3
View File
@@ -14,11 +14,10 @@ func main() {
println("ADXL345 starts")
for {
sensor.Update()
x, y, z := sensor.Acceleration()
x, y, z, _ := sensor.ReadAcceleration()
println("X:", x, "Y:", y, "Z:", z)
rx, ry, rz := sensor.RawXYZ()
rx, ry, rz := sensor.ReadRawAcceleration()
println("X (raw):", rx, "Y (raw):", ry, "Z (raw):", rz)
time.Sleep(100 * time.Millisecond)