Skip to content

Commit

Permalink
make tilt angle independent of the board orientation (#531)
Browse files Browse the repository at this point in the history
  • Loading branch information
m0n5t3r authored Oct 1, 2021
1 parent 73e406e commit 39f0751
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pio/src/iSpindel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ float calculateTilt()
if (ax == 0 && ay == 0 && az == 0)
return 0.f;

return acos(az / (sqrt(ax * ax + ay * ay + az * az))) * 180.0 / M_PI;
return acos(abs(az) / (sqrt(ax * ax + ay * ay + az * az))) * 180.0 / M_PI;
}

bool testAccel()
Expand Down

0 comments on commit 39f0751

Please sign in to comment.