Show Posts
Pages: [1]
1  Using Arduino / Sensors / Re: Strange behavior of MPU6050 on: February 23, 2013, 03:27:08 am
Its the acceleration in the x Direktion! The *ax value from the getValues-Function!
2  Using Arduino / Sensors / Strange behavior of MPU6050 on: February 22, 2013, 03:20:06 pm

i have a little problem with my MPU6050 sensor, when i dont move the sensor i get the following values as you can see in this picture (the timespan is 40secs)

for reading the values from the sensor i use the following code:
#include "Motion.h"

#include "MPU6050_6Axis_MotionApps20.h"

MPU6050 mpu;

int Motion::init()
    dmpReady = false;
    mpuInterrupt = false;
    devStatus = mpu.dmpInitialize();
    if(devStatus == 0)
        mpuIntStatus = mpu.getIntStatus();
        dmpReady = true;
        packetSize = mpu.dmpGetFIFOPacketSize();
    return devStatus;

int Motion::getValues(float *ax, float *ay, float *az, float *gz)
    if(!dmpReady) return 1;
    if(!mpuInterrupt) return 2;
    mpuInterrupt = false;
    mpuIntStatus = mpu.getIntStatus();
    fifoCount = mpu.getFIFOCount();
    if(fifoCount < packetSize) return 3;
    if((mpuIntStatus & 0x10) || fifoCount == 1024)
        return -1;
    if(!(mpuIntStatus & 0x02)) return 4;
    mpu.getFIFOBytes(fifoBuffer, packetSize);
    Quaternion q;           // [w, x, y, z]         quaternion container
    VectorInt16 aa;         // [x, y, z]            accel sensor measurements
    VectorInt16 aaReal;     // [x, y, z]            gravity-free accel sensor measurements
    VectorFloat gravity;    // [x, y, z]            gravity vector
    float ypr[3];           // [yaw, pitch, roll]   yaw/pitch/roll container and gravity vector
    mpu.dmpGetQuaternion(&q, fifoBuffer);
    mpu.dmpGetGravity(&gravity, &q);
    mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);
    mpu.dmpGetAccel(&aa, fifoBuffer);
    mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);
    *ax = (aaReal.x/16384.0) * 9.81;
    *ay = (aaReal.y/16384.0) * 9.81;
    *az = (aaReal.z/16384.0) * 9.81;
    *gz = (ypr[2]/131.0) * 180/M_PI;
    return 0;

in the setup()-method I call Motion::init() and in the loop-method I call Motion::getValues.
Can anyone explain why I get these strange values or what i am doing wrong??

I have used the libraries from an my code is very similar to his examples.


greetings stefan
3  Community / Exhibition / Gallery / ArduinoMonitor on: January 19, 2013, 05:10:55 pm

i want introduce to you a little application i have written to easily debug your programs for the Arduino.
With ArduinoMonitor you can not only receive and send messages from the Arduino you have also a live-graph with the data comming from the Arduino and a little window with status messages from the Arduino.

Maybe ArduinoMonitor is also helpful for some of you and i am happy if i get some feedback.

# Release Notes
## 2013-02-10:
  * Import/Export functionality added
  * Multiple plots
  * Zoom/pan with mouse
  * changed UI

- stefan
Pages: [1]