mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-10 01:43:40 +00:00
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:
committed by
Ayke van Laethem
parent
b7fe897b8c
commit
8ac1fa2b22
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user