From: Paul Hänsch Date: Sun, 10 Mar 2019 18:09:22 +0000 (+0100) Subject: swap axis of accelerometer to emulate android norm X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=f5a7e027d48f68f88336a088a44135dc10b19d31;p=rpi_small swap axis of accelerometer to emulate android norm --- 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 \