Jump to content
I2Cdevlib Forums

Ale

Members
  • Posts

    4
  • Joined

  • Last visited

Ale's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Try this: void setup() { // join I2C bus (I2Cdev library doesn't do this automatically) #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE Wire.begin(); Wire.setClock(200000); // 400kHz I2C clock. Comment this line if having compilation difficulties #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE Fastwire::setup(200, true); #endif
  2. Sorry I'm in trouble!!!! The magnetometer is fully working, but the yaw drift!!!!!!!!! Ihave made a test with a magneto, and the yaw was changed!!!!
  3. Good news. I have resolved my problem. The errors are in the Motionapps41 file, and are more of one. In the first remember that my 9150 is ADO High, (0x69). In the second remember that my magnetometer is at 0x0C address. This the guideline: I have changed all "DevAddr" in th file with the 0x69. I have changed all 0X68 call (except in the memory bank declaration) with 0X69. I have changed those lines(before the key was (0X0E) DEBUG_PRINTLN(F("Setting magnetometer mode to power-down...")); //mag -> setMode(0); I2Cdev::writeByte(0X0C, 0x0A, 0x00); DEBUG_PRINTLN(F("Setting magnetometer mode to fuse access...")); //mag -> setMode(0x0F); I2Cdev::writeByte(0X0C, 0x0A, 0x0F); DEBUG_PRINTLN(F("Reading mag magnetometer factory calibration...")); int8_t asax, asay, asaz; //mag -> getAdjustment(&asax, &asay, &asaz); I2Cdev::readBytes(0X0C, 0x10, 3, buffer); I have changed this line (before the key was (0X0E) DEBUG_PRINTLN(F("Setting AK8975 to single measurement mode...")); //mag -> setMode(1); I2Cdev::writeByte(0X0C, 0x0A, 0x01); I have changed those lines (before the key was (.X.E) // setup AK8975 (0X0C) as Slave 0 in read mode DEBUG_PRINTLN(F("Setting up AK8975 read slave 0...")); I2Cdev::writeByte(0X69, MPU9150_RA_I2C_SLV0_ADDR, 0x8C); I2Cdev::writeByte(0X69, MPU9150_RA_I2C_SLV0_REG, 0x01); I2Cdev::writeByte(0X69, MPU9150_RA_I2C_SLV0_CTRL, 0xDA); // setup AK8975 (0X0C) as Slave 2 in write mode DEBUG_PRINTLN(F("Setting up AK8975 write slave 2...")); I2Cdev::writeByte(0X69, MPU9150_RA_I2C_SLV2_ADDR, 0x0C); I2Cdev::writeByte(0X69, MPU9150_RA_I2C_SLV2_REG, 0x0A); I2Cdev::writeByte(0X69, MPU9150_RA_I2C_SLV2_CTRL, 0x81); I2Cdev::writeByte(0X69, MPU9150_RA_I2C_SLV2_DO, 0x01); Now all is working and without error. The only thing is that the MAGNETOMETER IS NOT CONSIDERATE IN THE DMP. Please give me a suggestion...... Ale
  4. Hi. I have a problem on my 9150 and arduino. In the past I have made a code for 6050 (with ADO HIGH 0X69) and all was ok and great. I have used the 6050 library and 6050 motionapps 20 library, and, i repeat, all was fine and ok AND dmp WORK very nice. Now, I have tried to use my 9150 (with ADO HIGH 0X69) with the libraru 9150 motion app 41 and all is a disaster... I have downloaded the code for github, but the first thing that i have see is that the arduino IDE was in error to compile it. To solve the problem, i have copied the 6050 motion app 41 and i have replaced the "6050" text with "9150" and now all is ok. But this is not the problem.... The problem is that the 9150_dmp9 is still not working (whitout any error now...) After this, i have found a simple code to read the 9150 raw value of gyro, acc and magneto and ALL IS WORKING. This step was to check the correct work of the sensor, and now I know is ok. Now i have loaded 9150_dmp9 with motionapp41 "modified" and I have activate the debug of the library to know in whis lines are the errors. Now i know yhe problem is in those lines: DEBUG_PRINTLN(F("Waiting for FIRO count >= 46...")); while ((fifoCount = getFIFOCount()) < 46); DEBUG_PRINTLN(F("Reading FIFO...")); getFIFOBytes(fifoBuffer, min(fifoCount, 128)); // safeguard only 128 bytes DEBUG_PRINTLN(F("Reading interrupt status...")); getIntStatus(); and if I try to "comment" with // I have the same error on the following lines... I think the error is NOT in the previous lines, but in an another part of the code..... remember that my 9150 is ADOhigh (0x69) and the magneto is (0x0C). Please help me, and sorry for my bad language...
×
×
  • Create New...