diff --git a/src/MPU6050_light.cpp b/src/MPU6050_light.cpp index 738b3cd..a1d4142 100644 --- a/src/MPU6050_light.cpp +++ b/src/MPU6050_light.cpp @@ -208,3 +208,21 @@ void MPU6050::update(){ angleZ += gyroZ*dt; // not wrapped } + +/* RESET ANGLE */ + +void MPU6050::resetAllAngles(){ + angleX = angleY = angleZ = 0; +} + +void MPU6050::resetAngleX(){ + angleX = 0; +} + +void MPU6050::resetAngleY(){ + angleY = 0; +} + +void MPU6050::resetAngleZ(){ + angleZ = 0; +} \ No newline at end of file diff --git a/src/MPU6050_light.h b/src/MPU6050_light.h index 2b310c3..70e05ca 100644 --- a/src/MPU6050_light.h +++ b/src/MPU6050_light.h @@ -96,6 +96,10 @@ class MPU6050{ // UPSIDE DOWN MOUNTING bool upsideDownMounting = false; + void resetAllAngles(); + void resetAngleX(); + void resetAngleY(); + void resetAngleZ(); private: TwoWire *wire;