Jump to content
I2Cdevlib Forums

MPU6050 gives the same values every time


Recommended Posts

Hello,

 

I use the MPU6050 with an ESP8266. I have connected it to VCC, Ground, SDA, SCL of the ESP8266. When I power the board for an amount of time the MPU6050 works perfectly. However, after some moment it returns the same values no matter moving it. I first thought it was the buffer and tried emptying it at a specific amount of time. However, this made the problem appear sooner than before. After a restart of the ESP9266 board, the MPU6050 works fine again.

 

This is the code which I use to obtain the values from it:


    in setup:

    const int MPU_addr=0x68;
    Wire.begin();
    Wire.beginTransmission(MPU_addr);
    Wire.write(0x6B);
    Wire.write(0);
    Wire.endTransmission(true);
    delay(10);
    
    in loop:

    Wire.beginTransmission(MPU_addr);
    Wire.write(0x3B);
    Wire.endTransmission(false);
    Wire.requestFrom(MPU_addr,14,true);
    AcX=Wire.read()<<8|Wire.read();
    AcY=Wire.read()<<8|Wire.read();
    AcZ=Wire.read()<<8|Wire.read();
    Tmp=Wire.read()<<8|Wire.read();
    GyX=Wire.read()<<8|Wire.read();
    GyY=Wire.read()<<8|Wire.read();
    GyZ=Wire.read()<<8|Wire.read();
    //Applying a formula to turn raw values into Yaw, Pitch and Roll
    int16_t roll=atan2(AcY,AcZ)*180/PI;
    int16_t pitch=atan2(AcX,sqrt(AcY*AcY+AcZ*AcZ))*180/PI;

If the values that repeat are important, I can provide them. They are the same every time.

 

What am I doing wrong?

 

Thank you in advance!!!

Link to comment
Share on other sites

  • 2 weeks later...
  • 8 years later...

I hope you reply pls pls pls

I am making similar projects using Arduino mini pro and mpu6050 and it's giving same value everytime I've tried every single thing but I remember from your post that I also haven't soldered them rather I have used breadboard instead will it work fine if I solder it ?  Your reply will be help full i have to submit this project in a week

Link to comment
Share on other sites

  • 1 year later...
Girls In Your Town - No Selfie - Anonymous Casual Dating
https://SecretPrivat.com

[url=https://SecretPrivat.com] Womens In Your City [/url] - Anonymous Sex Dating - No Selfie

New Girls
[url=https://SecretPrivat.com/girl/bella-59.html]Bella[/url]
[url=https://SecretPrivat.com/girl/bamby-belle-104.html]Bamby Belle[/url]
[url=https://SecretPrivat.com/girl/bella-pregnant-99.html]Bella Pregnant[/url]
[url=https://SecretPrivat.com/girl/hailey-sinclair-77.html]HAILEY SINCLAIR[/url]
[url=https://SecretPrivat.com/girl/lola-la-fleur-11.html]Lola La Fleur[/url]
[url=https://SecretPrivat.com/girl/lexy-106.html]LEXY[/url]
[url=https://SecretPrivat.com/girl/hanna-zimmer-53.html]Hanna Zimmer[/url]
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...