Jump to content
I2Cdevlib Forums

pammie

Members
  • Posts

    8
  • Joined

  • Last visited

pammie's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi Jeff, thank you very much. It's amazing that you know an answer to all these questions . By the way: 100 Hz is for a 16 Mhz Arduino?? That is 50Hz for a 8 Mhz (I'm using Arduino Fio)??? Regarding the decision about interrupts: I would like to discuss about that, but I will make a different thread for it.
  2. Hi, well.... I'm not even sure about my own code. But it seems we have the same problem so we can figure it out. The documentation says: motion processing algorithms should be run at a high rate, often around 200Hz, in order to provide accurate results with low latency. This is required even if the application updates at a much lower rate; for example, a low power user interface may update as slowly as 5Hz, but the motion processing should still run at 200Hz. As I understand it this means setting the rate divider at 4 to obtain a sample frequency of 200 Hz (as in the DMP example code). The dmp code block specifies a fifo rate of 100 Hz by setting the divider to 1 200 Hz/(1 + 1). I suppose the dmp interrupt is triggered at this frequency as the fifocounter increases with 1 or 2 42 byte blocks?? Does this mean the DMP averages the data in between??? What if I sample at 200 Hz and read the FIFO at 20 Hz?? Do I have 10 packets in the FIFO?? Which can be averaged?? Or does the FIFO contain just 1 averaged package??? Well something to try out I think (tomorrow)
  3. Hi Ji, I think it's a function called setRate. It's defined in mpu6050.h and incorporated in mpu6050.cpp. But it seems it is not called for in the MPU6050 Raw example. I would put it in initialize, I'm using the DMPexample, also without interrupt. What I understood is that MPU6050 sample frequency should be higher as the polling frequency. I,m testing on MPUint bit from the interrupt status register, and that seems to work. Like this: mpuIntStatus = mpuL.getIntStatus(); // get int status fifoCount = mpuL.getFIFOCount(); if (mpuIntStatus & 0x02) { while (fifoCount < packetSize) fifoCount = mpuL.getFIFOCount(); mpuL.getFIFOBytes(fifoBuffer, packetSize); fifoCount -= packetSize; mpuL.dmpGetQuaternion(&q, fifoBuffer); mpuL.dmpGetYawPitchRoll(ypr, &q, &gravity); mpuL.dmpGetAccel(&aa, fifoBuffer); mpuL.dmpGetGravity(&gravity, &q); mpuL.dmpGetLinearAccel(&aaReal, &aa, &gravity); mpuL.dmpGetLinearAccelInWorld(&aaWorld, &aaReal, &q); Buffer[0] = ypr[0] * 180/M_PI; Buffer[1] = ypr[1] * 180/M_PI; Buffer[2] = ypr[2] * 180/M_PI; Buffer[3] = aaWorld.x; Buffer[4] = aaWorld.y; Buffer[5] = aaWorld.z; mpuL.resetFIFO(); // export it to pure data stuff } } my sample rate is 200 Hz, polling frequency about 10 Hz. But I'm not sure or the DMP uses all information in the FIFO. Maybe Jeff knows?? Greetings, Pam
  4. Hi Riccati, good you fixed it. Nice little program this I2C scanner, Greetings, Pamela
  5. Hai Jeff, that is a nice solution, thanks, greetings, Pamela
  6. Just an addition.. First I tried to use the specific address constructor in mpu6050.cpp In my sketch it says: .... MPU6050 mpu; ..... mpu.MPU6050(MPU6050_ADDRESS_AD0_HIGH); // actions for MPU at high address .... mpu.MPU6050(MPU6050_ADDRESS_AD0_LOW); // actions for MPU at low address ....
  7. Hello, I connected 2 MPU6050's and 2 MMA8452's to a Arduino Fio. I'm using the DMP for the 6050's. Altering the example code for the MMA8452 to adress them at different adresses was not that difficult. I adapted the functions to pass the device adress. The example code for the MPU6050 is a lot bigger and complexer so I was wondering how I could pass the device address as a global variable. Tried some, but compiler keeps on protesting. Has someone experience with this?? Greetings, Pamela
  8. Hello Riccati, I think it can be a hardware problem, or maybe you don't have Vio connected to Vdd. Greetings, Pam
×
×
  • Create New...