]> git.plutz.net Git - rpi_small/blobdiff - files_gyro/opt/gyro/mpu6050.sh
swap axis of accelerometer to emulate android norm
[rpi_small] / files_gyro / opt / gyro / mpu6050.sh
index 7184bfff3370b9d7363f03007ae642911e427379..ca8d3f5daa6a18eb0d705daa2ec5a3582ca4cb5a 100755 (executable)
@@ -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 \