Jump to content
I2Cdevlib Forums

MGtan

Members
  • Posts

    2
  • Joined

  • Last visited

  • Days Won

    2

MGtan last won the day on October 10 2017

MGtan had the most liked content!

MGtan's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I am not sure I am correct or not but Integration of angular velocity should give you static angle right?
  2. Hi, I have a very weird condition now. I am currently using Sparkfun MPU6050 and I had modified Jeff code so that I can store the result in excel file (through PLX-DAQ). Below is my modified code: //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #include "I2Cdev.h" #include "MPU6050.h" #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE #include "Wire.h" #endif MPU6050 accelgyro; int16_t ax, ay, az; int16_t gx, gy, gz; #define OUTPUT_READABLE_ACCELGYRO //#define OUTPUT_BINARY_ACCELGYRO unsigned long time; void setup() { // join I2C bus (I2Cdev library doesn't do this automatically) #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE Wire.begin(); #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE Fastwire::setup(400, true); #endif Serial.println("CLEARDATA"); Serial.println("LABEL,Time,time,ax,ay,az,gx,gy,gz"); } void loop() { time=millis(); // read raw accel/gyro measurements from device accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz); Serial.print("DATA,TIME,"); Serial.print(time); Serial.print(","); Serial.print(ax); Serial.print(","); Serial.print(ay); Serial.print(","); Serial.print(az); Serial.print(","); Serial.print(gx); Serial.print(","); Serial.print(gy); Serial.print(","); Serial.println(gz); delay(10); } ////////////////////////////////////////////////////////////////////////////////////////////////////////////// However, the results become all zero after some time of using MPU6050. I need to re-upload the original Jeff unmodified code again, then only upload my modified code. This will goes on and on and I need to figure out why????? HELP ME!!!
×
×
  • Create New...