From f5a7e027d48f68f88336a088a44135dc10b19d31 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Sun, 10 Mar 2019 19:09:22 +0100 Subject: [PATCH] swap axis of accelerometer to emulate android norm --- files_gyro/opt/gyro/mpu6050.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/files_gyro/opt/gyro/mpu6050.sh b/files_gyro/opt/gyro/mpu6050.sh index 7184bff..ca8d3f5 100755 --- a/files_gyro/opt/gyro/mpu6050.sh +++ b/files_gyro/opt/gyro/mpu6050.sh @@ -58,6 +58,8 @@ done \ # derive bearing from rotation aa=$((aa + a / 10)) ab=$((ab + b / 10)) ac=$((ac + c / 10)) + # print data and swap axis + # axis swap dependent on individual device layout printf 'event: motion data: %04i %04i %04i @@ -69,7 +71,7 @@ done \ event: temperature data: %04i - \n' $x $y $z \ + \n' $x $((-y)) $((-z)) \ $a $b $c \ $((aa * 12500 / 8192)) $((ab * 12500 / 8192)) $((ac * 12500 / 8192)) \ $t \ -- 2.39.2