Go Down

Topic: Library for MPU 6050 FIFO usage (Read 630 times) previous topic - next topic

emat

Jun 18, 2019, 08:23 pm Last Edit: Jun 19, 2019, 04:05 pm by emat
Hi,

I am using an MKR Wifi 1010 to send sonsor data of the MPU6050 to a server.
Because of timing issues, I need to enable the FIFO buffer. I found only two libraries working with this board (TinyMPU6050 and MPU6050_tockn), but they don't enable it.
The i2cdevlib/tree/master/Arduino/MPU6050 always gives me:

Code: [Select]
In file included from C:\Users\elias\AppData\Local\Temp\arduino_build_85197\sketch\i2c_MPU9250.ino.cpp:1:0:

E:\Dokumente\Arduino\libraries\I2C-Sensor-Lib_iLib\src/i2c.h: In constructor 'WirePlus::WirePlus()':

C:\Users\elias\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.20\cores\arduino/Arduino.h:116:37: error: no match for 'operator|=' (operand types are '_EPortType' and 'long unsigned int')

 #define bitSet(value, bit) ((value) |= (1UL << (bit)))

                                     ^

E:\Dokumente\Arduino\libraries\I2C-Sensor-Lib_iLib\src/i2c.h:70:5: note: in expansion of macro 'bitSet'

     bitSet(PORTC, 4);  // deactivate internal pull-ups for twi

     ^

C:\Users\elias\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.20\cores\arduino/Arduino.h:116:37: note: candidate is:

 #define bitSet(value, bit) ((value) |= (1UL << (bit)))

                                     ^

E:\Dokumente\Arduino\libraries\I2C-Sensor-Lib_iLib\src/i2c.h:70:5: note: in expansion of macro 'bitSet'

     bitSet(PORTC, 4);  // deactivate internal pull-ups for twi

     ^

C:\Users\elias\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.20\cores\arduino/Arduino.h:116:37: note: operator|=(_EPortType&, long unsigned int) <built-in>

 #define bitSet(value, bit) ((value) |= (1UL << (bit)))

                                     ^

E:\Dokumente\Arduino\libraries\I2C-Sensor-Lib_iLib\src/i2c.h:70:5: note: in expansion of macro 'bitSet'

     bitSet(PORTC, 4);  // deactivate internal pull-ups for twi

     ^

C:\Users\elias\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.20\cores\arduino/Arduino.h:116:37: note:   no known conversion for argument 1 from '_EPortType' to '_EPortType&'

 #define bitSet(value, bit) ((value) |= (1UL << (bit)))

                                     ^

E:\Dokumente\Arduino\libraries\I2C-Sensor-Lib_iLib\src/i2c.h:70:5: note: in expansion of macro 'bitSet'

     bitSet(PORTC, 4);  // deactivate internal pull-ups for twi

     ^

C:\Users\elias\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.20\cores\arduino/Arduino.h:116:37: error: no match for 'operator|=' (operand types are '_EPortType' and 'long unsigned int')

 #define bitSet(value, bit) ((value) |= (1UL << (bit)))

                                     ^

E:\Dokumente\Arduino\libraries\I2C-Sensor-Lib_iLib\src/i2c.h:71:5: note: in expansion of macro 'bitSet'

     bitSet(PORTC, 5);  // as per note from atmega8 manual pg167

     ^

C:\Users\elias\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.20\cores\arduino/Arduino.h:116:37: note: candidate is:

 #define bitSet(value, bit) ((value) |= (1UL << (bit)))

                                     ^

E:\Dokumente\Arduino\libraries\I2C-Sensor-Lib_iLib\src/i2c.h:71:5: note: in expansion of macro 'bitSet'

     bitSet(PORTC, 5);  // as per note from atmega8 manual pg167

     ^

C:\Users\elias\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.20\cores\arduino/Arduino.h:116:37: note: operator|=(_EPortType&, long unsigned int) <built-in>

 #define bitSet(value, bit) ((value) |= (1UL << (bit)))

                                     ^

E:\Dokumente\Arduino\libraries\I2C-Sensor-Lib_iLib\src/i2c.h:71:5: note: in expansion of macro 'bitSet'

     bitSet(PORTC, 5);  // as per note from atmega8 manual pg167

     ^

C:\Users\elias\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.20\cores\arduino/Arduino.h:116:37: note:   no known conversion for argument 1 from '_EPortType' to '_EPortType&'

 #define bitSet(value, bit) ((value) |= (1UL << (bit)))

                                     ^

E:\Dokumente\Arduino\libraries\I2C-Sensor-Lib_iLib\src/i2c.h:71:5: note: in expansion of macro 'bitSet'

     bitSet(PORTC, 5);  // as per note from atmega8 manual pg167

     ^

In file included from E:\Dokumente\Arduino\libraries\I2C-Sensor-Lib_iLib\examples\i2c_MPU9250\i2c_MPU9250.ino:2:0:

E:\Dokumente\Arduino\libraries\I2C-Sensor-Lib_iLib\src/i2c.h:73:5: error: 'TWBR' was not declared in this scope

     TWBR = ((F_CPU / 400000L) - 16) / 2; // see twi_init in Wire/utility/twi.c

     ^

Using library Wire at version 1.0 in folder: C:\Users\elias\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.20\libraries\Wire
Using library I2C-Sensor-Lib_iLib at version 0.8.2 in folder: E:\Dokumente\Arduino\libraries\I2C-Sensor-Lib_iLib
exit status 1
Error compiling for board Arduino MKR WiFi 1010.


I don't know so much about coding, that I could write my own code for that problem.
Any suggestions?


pert

Please do this:
  • When you encounter an error, you'll see a button on the right side of the orange bar "Copy error messages" in the Arduino IDE (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button..
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum's code tags markup to your reply.
  • Press "Ctrl + V". This will paste the error between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.


If the text exceeds the forum's 9000 character limit, save it to a .txt file and post it as an attachment. If you click the "Reply" button here, you will see an "Attachments and other settings" link.

Go Up