I’m trying to get a BNO080 to work with my Mkr WiFi 1010 board. I have the SCL and SDA ports soldered from the Arduino to the sensor, the VCC connected to 3.3V, and Gnd to Gnd.
When I run the example code the program uploads to the board with no errors but the board stops when it reaches the command myIMU.begin(). I added a Serial println command just before, and just after that line in the example doc. My serial monitor outputs the line before, but freezes before the next println.
Does anyone have any idea what could be going wrong here? Thanks.
Hi Paul,
Since the example code is just calling a generic “Wire.begin();” function, you’ll probably need to define your SDA and SCL pins manually in that function. That function works great for most AVR-based Arduinos but with other chip architectures that allow multiple I/O pins to function in different ways, like the ARM processor on the MKR, you need to set your SDA and SCL pins in the Wire.begin(); function. Try setting it up like this:
Wire.begin(SDA_PIN, SCL_PIN);
where you include the number for the SDA and SCL pins. If you’re not certain what I/O pins are assigned to SDA and SCL, you will need to refer to a pinout diagram or review the schematic on [Arduino’s MKR WiFi 1010 Product Page.](Arduino MKR WiFi 1010 — Arduino Official Store)
I just tried it with the following line:
Wire.begin(11, 12);
Same results.
Hi again Paul,
If manually setting the I2C pins does not work, I am afraid that most likely means the library is not compatible with the MKR WiFi 1000 by default. It might be limited to the I2C functionality so I would recommend trying with SPI before moving on to making modifications to the examples and possibly the [source files to get it working with that specific Arduino. [This issue, while not specifically related to the MKR might help give you some guidance on figuring out what is causing the problem since the MKR uses a SAMD21 as well.](Can't get example to work on SAMD21 · Issue #23 · sparkfun/SparkFun_BNO080_Arduino_Library · GitHub)](SparkFun_BNO080_Arduino_Library/src at main · sparkfun/SparkFun_BNO080_Arduino_Library · GitHub)