MLX90393 (Qwiic) magnetometer vs. LiquidCrystal library

We have the magnetometer breakout and Qwiic shield working properly on an Arduino Uno. A basic 1602A LCD display using the built-in LiquidCrystal library also works correctly. Combine them, and the magnetometer stops providing useful data. Specifically, adding:

#include <LiquidCrystal.h>

const int rs = 7, en = 8, d4 = 9, d5 = 10, d6 = 11, d7 = 12;

LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

causes the magnetometer to stop providing data, even if the LCD is not invoked in the sketch. I assume there is a collision between LiquidCrystal.h and MLX90393.h since the hardware seems happy as long as I don’t invoke the LCD constructor. Has anybody else run into this? Searches haven’t turned up anything.

Thanks,

Don

Hello kl7drice,

This is an issue that most likely hasn’t came up before. It definitely sounds like the two libraries are fighting each other. They might be trying to compete for the same resources. I would recommend switching to a serial LCD instead of the SPI version.