Page 1 of 1

MPU 6050 Stuck Values

Posted: Sat Nov 23, 2019 6:40 pm
by TheTroubledOne
hi guys,

i am using tokn's MPU6050 library and the following example code:

Code: Select all

#include <MPU6050_tockn.h>
#include <Wire.h>
float Yang,Xang,Zang,Y,X,Z;
MPU6050 mpu6050(Wire);

void setup() {
  Serial.begin(115200);
  Wire.begin();
  mpu6050.begin();
  mpu6050.calcGyroOffsets(true);
}

void loop() {
  mpu6050.update();
  Yang= mpu6050.getGyroAngleY();
  Xang= mpu6050.getGyroAngleX();
  Zang= mpu6050.getGyroAngleZ();
  Y= mpu6050.getGyroY();
  X= mpu6050.getGyroX();
  Z= mpu6050.getGyroZ();
  Serial.print("GyroX : ");
  Serial.print(X);
  Serial.print ("\tGyroAngX : ");
  Serial.print(Xang);
  Serial.print("\tGyroY : ");
  Serial.print(Y);
  Serial.print("\tGyroAngY : ");
  Serial.print(Yang);
  Serial.print("\tGyroZ : ");
  Serial.print(Z);
  Serial.print("\tGyroAngZ : ");
  Serial.println(Zang);
  delay(100);
  
}
For some reason, the values get stuck at random times in explanation X,Y,Z gets stuck and Xang,Yang,Zang values keeps incrementing by 0.10 .
BTW, I am using a DOIT ESP32 DEVKIT 1.

Re: MPU 6050 Stuck Values

Posted: Thu Feb 13, 2020 5:04 pm
by kumarjha
Have you got your answer?