X-Git-Url: https://git.plutz.net/?p=rpi_small;a=blobdiff_plain;f=files_gyro%2Fopt%2Fgyro%2Fmpu6050.sh;fp=files_gyro%2Fopt%2Fgyro%2Fmpu6050.sh;h=ca8d3f5daa6a18eb0d705daa2ec5a3582ca4cb5a;hp=7184bfff3370b9d7363f03007ae642911e427379;hb=f5a7e027d48f68f88336a088a44135dc10b19d31;hpb=ea54ae250751ee5cb2c27c11f8d7758d03a55058 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 \