

Cant put in a photo, my 10 years old "smartphone" camera doesnt work anymore - yes I know. The motor and I2C are separate, meaning GND from nano 33 goes to motor driver, and another GND goes to VL6180X, but problem does also occur even with motor not running but very seldom, but again that one time it happens, the sketch must not stop. OK I understand regarding timeout, and requestFrom(), but I wanted to try at least something, and thats were my knowledge ends. (last print being "I 3" or "I 4") uint8_t I2Cread(uint16_t reg) while((value= 0) & (timeOut> millis())) When the sketch hang up its happening at Wire.endTransmission or Wire.requestFrom, so my timeout doesn’t even come into any use. Meaning that instead of using pololus ToF1.readReg(0x04F) I now use my own I2Cread(0x04F). Unfortunately that didn’t bring any luck.

Putting in a timeout functionality and using wire.available. Now I have tried to make my own modification to the pololu VL6180X library, controlling the use of the Wire functions. (Hope my english is understandable, and links now OK) : ) And and as mentioned actually works, but sometimes may be after minutes one error occurs and sketch stops. Regarding the HW (sorry for missing photo) but it is as simple as SCL-SCL SDA-SDA, also tried to noise protect two lines with grounded aluminum foil, short wires around 75 mm, not twisted, only "trouble" being a small DC motor near by - with 3 X 0,1 uF for noise. To my understanding, looking/"searhing around", the fixing of the halting bug in the SAMD wire library has not been implemented. GitHub - freespace/SBWire: Modified Arduino Wire library which implements basic timeout. OK, I think I understand your point about the bit flip, and must admit Im not experienced to know how the SBWire library have fixed this, but in the readme it says " twi_stop() is called followed by twi_init()" on timeout.
