# 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
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 \