Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
wollewald authored Jul 7, 2022
1 parent 2b5c166 commit b3e5b84
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/MPU6500_WE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,10 +546,11 @@ String MPU6500_WE::getOrientationAsString(){

float MPU6500_WE::getPitch(){
xyzFloat angleVal = getAngles();
float pitch = (atan2(angleVal.x, sqrt(abs((angleVal.x*angleVal.y + angleVal.z*angleVal.z))))*180.0)/M_PI;
float pitch = (atan2(-angleVal.x, sqrt(abs((angleVal.y*angleVal.y + angleVal.z*angleVal.z))))*180.0)/M_PI;
return pitch;
}


float MPU6500_WE::getRoll(){
xyzFloat angleVal = getAngles();
float roll = (atan2(angleVal.y, angleVal.z)*180.0)/M_PI;
Expand Down

0 comments on commit b3e5b84

Please sign in to comment.