My setup uses a ToF VL53L1X and an 0.96" OLED (Adafruit_GFX.h, Adafruit_SSD1306.h and VL53L1X.h libraries) a Nano V3.0 host and a 400 kHz I2C bus intended to communicate with the two devices. By them selves they work fine.
I add code stepwise to verify the functionality and I use the serial monitor to basically output the same info as to the OLED.
A version with minimal functionality using both devices works fine and it did also without the mod described below. However very consistently when adding display.* code (OLED writings) it stops executing.
To combat the level issue above I disabled the internal pullup's with; digitalWrite(SDA, LOW), digitalWrite(SCL, LOW); and connected them externally to 3.3V via 10k resistors. With this mod...
- ...it was possible to run the code (enabled display.* writings) a few times before it stopped executing. Without the mod it never executed! The mod had some effect but didnt solve the whole problem!. Obs! It is still a bread board solution which would cause more randomness behaviour than what I see if that was the real problewm.
- ...it never displays anything on the OLED. Works fine with the minimum code.
- ...a variable intended to be displayed on OLED aswell serial gets messed up. No problems when display.* code is disabled.
I am thinking of having an SPI display instead but if it is a memory, or something similar, problem than that might not be a solution.