Connection to Arduino lost after invoking scanI2CBus
4 views (last 30 days)
I have an Arduino Mega 2560 connected via USB to my computer. Invoking the arduino function works fine and gets the connection token without problems. But whenever I try to use the scanI2CBus function, I lose the connection and can't reestablish it without restarting Matlab.
There are 2 SparkFun MPU 9250 IMUs wired to the Arduino via I2C, one of which is new so I wanted to scan the bus for the address. No matter if both or either one is connected, the connection is lost.
Does anyone have an idea what could cause such behaviour?