Hello,
as far as I know the Wire library is the same for all the boards no matter if I have a Pro Mini or a MKRZero, correct?
I have an existing project for Pro Mini, but since the performance is not sufficient I want to change to the MKR Zero. I am using the online Editor of Arduino and include the "Wire.h" standard library. Furthermore I use another library for a DMP (digital motion processor) which is connected via the I2C, so the library of the DMP is using the macros from Wire.h
When I choose the Board "Pro Mini" all sketches compile correctly. When I choose the MKR Zero it terminates with an error:
'BUFFER_LENGTH' was not declared in this scope
Since BUFFER_LENGTH is a macro defined in the Wire.h (see link below) I am asking if there are different libraries called "Wire" for each different processor on Arduino boards. If not: What exactly changes when I choose "MKR Zero" instead of "Pro Mini" in the Webeditor?
littek:
as far as I know the Wire library is the same for all the boards no matter if I have a Pro Mini or a MKRZero, correct?
Incorrect. The Wire library is hardware specific so each hardware package bundles its own version of it. The Wire library associated with the hardware package of the currently selected board is used. So when you select Tools > Board > Arduino Pro or Pro Mini This library is used:
Which does contain the BUFFER_LENGTH definition here:
When you select Tools > Board > Arduino MKRZERO this Wire library is used:
which does not contain any buffer length definition. It does include RingBuffer.h:
Which contains the following definition:
#define SERIAL_BUFFER_SIZE 64
Without looking closer at the code I can't be sure if that will be the SAMD equivalent of BUFFER_LENGTH.
That's the ESP8266 core for Arduino hardware package. It has nothing to do with the Pro Mini (which uses the Arduino AVR Boards hardware package). or the MKRZERO (which uses the Arduino SAMD Boards hardware package).
Well, guess I will have to take a look if I can find MPU6050 libraries suiting the MKRZero, because sadly adding the missing BUFFER_LENGTH does not solve all problems.