Jump to content
I2Cdevlib Forums

OS1511

Members
  • Content Count

    1
  • Joined

  • Last visited

  1. I2c library is not working on arduino Due. I comment the TWR line as mentioned in other post. When I compiled the program, I received this error as shown in picture. Can anyone please help me? C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp: In member function 'void MPU6050::PID(uint8_t, float, float, uint8_t)': C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:3258:65: error: invalid conversion from 'int16_t* {aka short int*}' to 'uint16_t* {aka short unsigned int*}' [-fpermissive] I2Cdev::readWords(devAddr, SaveAddress + (i * shift), 1, &Data); // reads 1 or more 16 bit integers (Word) ^ In file included from C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.h:40:0, from C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:38: C:\Program Files (x86)\Arduino\libraries\I2Cdev/I2Cdev.h:115:23: error: initializing argument 4 of 'static int8_t I2Cdev::readWords(uint8_t, uint8_t, uint8_t, uint16_t*, uint16_t)' [-fpermissive] static int8_t readWords(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint16_t *data, uint16_t timeout=I2Cdev::readTimeout); ^ C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:3272:63: error: invalid conversion from 'int16_t* {aka short int*}' to 'uint16_t* {aka short unsigned int*}' [-fpermissive] I2Cdev::readWords(devAddr, ReadAddress + (i * 2), 1, &Data); // reads 1 or more 16 bit integers (Word) ^ In file included from C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.h:40:0, from C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:38: C:\Program Files (x86)\Arduino\libraries\I2Cdev/I2Cdev.h:115:23: error: initializing argument 4 of 'static int8_t I2Cdev::readWords(uint8_t, uint8_t, uint8_t, uint16_t*, uint16_t)' [-fpermissive] static int8_t readWords(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint16_t *data, uint16_t timeout=I2Cdev::readTimeout); ^ C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:3283:69: error: invalid conversion from 'int16_t* {aka short int*}' to 'uint16_t* {aka short unsigned int*}' [-fpermissive] I2Cdev::writeWords(devAddr, SaveAddress + (i * shift), 1, &Data); ^ In file included from C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.h:40:0, from C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:38: C:\Program Files (x86)\Arduino\libraries\I2Cdev/I2Cdev.h:124:21: error: initializing argument 4 of 'static bool I2Cdev::writeWords(uint8_t, uint8_t, uint8_t, uint16_t*)' [-fpermissive] static bool writeWords(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint16_t *data); ^ C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:3301:68: error: invalid conversion from 'int16_t* {aka short int*}' to 'uint16_t* {aka short unsigned int*}' [-fpermissive] I2Cdev::writeWords(devAddr, SaveAddress + (i * shift), 1, &Data ); ^ In file included from C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.h:40:0, from C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:38: C:\Program Files (x86)\Arduino\libraries\I2Cdev/I2Cdev.h:124:21: error: initializing argument 4 of 'static bool I2Cdev::writeWords(uint8_t, uint8_t, uint8_t, uint16_t*)' [-fpermissive] static bool writeWords(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint16_t *data); ^ C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp: In member function 'void MPU6050::PrintActiveOffsets()': C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:3315:81: error: invalid conversion from 'int16_t* {aka short int*}' to 'uint16_t* {aka short unsigned int*}' [-fpermissive] if(AOffsetRegister == 0x06) I2Cdev::readWords(devAddr, AOffsetRegister, 3, Data); ^ In file included from C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.h:40:0, from C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:38: C:\Program Files (x86)\Arduino\libraries\I2Cdev/I2Cdev.h:115:23: error: initializing argument 4 of 'static int8_t I2Cdev::readWords(uint8_t, uint8_t, uint8_t, uint16_t*, uint16_t)' [-fpermissive] static int8_t readWords(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint16_t *data, uint16_t timeout=I2Cdev::readTimeout); ^ C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:3317:54: error: invalid conversion from 'int16_t* {aka short int*}' to 'uint16_t* {aka short unsigned int*}' [-fpermissive] I2Cdev::readWords(devAddr, AOffsetRegister, 1, Data); ^ In file included from C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.h:40:0, from C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:38: C:\Program Files (x86)\Arduino\libraries\I2Cdev/I2Cdev.h:115:23: error: initializing argument 4 of 'static int8_t I2Cdev::readWords(uint8_t, uint8_t, uint8_t, uint16_t*, uint16_t)' [-fpermissive] static int8_t readWords(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint16_t *data, uint16_t timeout=I2Cdev::readTimeout); ^ C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:3318:56: error: invalid conversion from 'int16_t* {aka short int*}' to 'uint16_t* {aka short unsigned int*}' [-fpermissive] I2Cdev::readWords(devAddr, AOffsetRegister+3, 1, Data+1); ^ In file included from C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.h:40:0, from C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:38: C:\Program Files (x86)\Arduino\libraries\I2Cdev/I2Cdev.h:115:23: error: initializing argument 4 of 'static int8_t I2Cdev::readWords(uint8_t, uint8_t, uint8_t, uint16_t*, uint16_t)' [-fpermissive] static int8_t readWords(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint16_t *data, uint16_t timeout=I2Cdev::readTimeout); ^ C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:3319:56: error: invalid conversion from 'int16_t* {aka short int*}' to 'uint16_t* {aka short unsigned int*}' [-fpermissive] I2Cdev::readWords(devAddr, AOffsetRegister+6, 1, Data+2); ^ In file included from C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.h:40:0, from C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:38: C:\Program Files (x86)\Arduino\libraries\I2Cdev/I2Cdev.h:115:23: error: initializing argument 4 of 'static int8_t I2Cdev::readWords(uint8_t, uint8_t, uint8_t, uint16_t*, uint16_t)' [-fpermissive] static int8_t readWords(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint16_t *data, uint16_t timeout=I2Cdev::readTimeout); ^ C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:3308:196: error: 'dtostrf' was not declared in this scope #define printfloatx(Name,Variable,Spaces,Precision,EndTxt) Serial.print(F(Name)); {char S[(Spaces + Precision + 3)];Serial.print(F(" ")); Serial.print(dtostrf((float)Variable,Spaces,Precision ,S));}Serial.print(F(EndTxt));//Name,Variable,Spaces,Precision,EndTxt ^ C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:3322:2: note: in expansion of macro 'printfloatx' printfloatx("", Data[0], 5, 0, ", "); ^ C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:3308:196: error: 'dtostrf' was not declared in this scope #define printfloatx(Name,Variable,Spaces,Precision,EndTxt) Serial.print(F(Name)); {char S[(Spaces + Precision + 3)];Serial.print(F(" ")); Serial.print(dtostrf((float)Variable,Spaces,Precision ,S));}Serial.print(F(EndTxt));//Name,Variable,Spaces,Precision,EndTxt ^ C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:3323:2: note: in expansion of macro 'printfloatx' printfloatx("", Data[1], 5, 0, ", "); ^ C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:3308:196: error: 'dtostrf' was not declared in this scope #define printfloatx(Name,Variable,Spaces,Precision,EndTxt) Serial.print(F(Name)); {char S[(Spaces + Precision + 3)];Serial.print(F(" ")); Serial.print(dtostrf((float)Variable,Spaces,Precision ,S));}Serial.print(F(EndTxt));//Name,Variable,Spaces,Precision,EndTxt ^ C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:3324:2: note: in expansion of macro 'printfloatx' printfloatx("", Data[2], 5, 0, ", "); ^ C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:3325:42: error: invalid conversion from 'int16_t* {aka short int*}' to 'uint16_t* {aka short unsigned int*}' [-fpermissive] I2Cdev::readWords(devAddr, 0x13, 3, Data); ^ In file included from C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.h:40:0, from C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:38: C:\Program Files (x86)\Arduino\libraries\I2Cdev/I2Cdev.h:115:23: error: initializing argument 4 of 'static int8_t I2Cdev::readWords(uint8_t, uint8_t, uint8_t, uint16_t*, uint16_t)' [-fpermissive] static int8_t readWords(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint16_t *data, uint16_t timeout=I2Cdev::readTimeout); ^ C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:3308:196: error: 'dtostrf' was not declared in this scope #define printfloatx(Name,Variable,Spaces,Precision,EndTxt) Serial.print(F(Name)); {char S[(Spaces + Precision + 3)];Serial.print(F(" ")); Serial.print(dtostrf((float)Variable,Spaces,Precision ,S));}Serial.print(F(EndTxt));//Name,Variable,Spaces,Precision,EndTxt ^ C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:3327:2: note: in expansion of macro 'printfloatx' printfloatx("", Data[0], 5, 0, ", "); ^ C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:3308:196: error: 'dtostrf' was not declared in this scope #define printfloatx(Name,Variable,Spaces,Precision,EndTxt) Serial.print(F(Name)); {char S[(Spaces + Precision + 3)];Serial.print(F(" ")); Serial.print(dtostrf((float)Variable,Spaces,Precision ,S));}Serial.print(F(EndTxt));//Name,Variable,Spaces,Precision,EndTxt ^ C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:3328:2: note: in expansion of macro 'printfloatx' printfloatx("", Data[1], 5, 0, ", "); ^ C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:3308:196: error: 'dtostrf' was not declared in this scope #define printfloatx(Name,Variable,Spaces,Precision,EndTxt) Serial.print(F(Name)); {char S[(Spaces + Precision + 3)];Serial.print(F(" ")); Serial.print(dtostrf((float)Variable,Spaces,Precision ,S));}Serial.print(F(EndTxt));//Name,Variable,Spaces,Precision,EndTxt ^ C:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050.cpp:3329:2: note: in expansion of macro 'printfloatx' printfloatx("", Data[2], 5, 0, "\n"); ^ exit status 1 Error compiling for board Arduino Due (Native USB Port).
×