I'm creating a project using adafruits gfx library and an OBDII library, and they seem to be conflicting with each other somehow.
void setup(){
display.begin(OLED_ADDRESS, true);
display.clearDisplay();
display.setCursor(0, 0);
display.setTextColor(SH110X_WHITE);
display.setTextSize(2);
display.print("CAR-LOS");
display.display();
//obd.begin();
display.setCursor(0, 32);
display.setTextSize(1);
display.print("Connecting...");
display.display();
delay(3000);
//while (!obd.init());
}
When the calls to the obd object (specifically obd.begin()) are commented out, my OLED display works just fine, but when they are included, the display refuses to update.
Here's the definition of begin():
byte COBD::begin()
{
long baudrates[] = {115200, 38400};
byte version = 0;
for (byte n = 0; n < sizeof(baudrates) / sizeof(baudrates[0]); n++) {
#ifndef ESP32
OBDUART.begin(baudrates[n]);
#else
OBDUART.begin(baudrates[n], SERIAL_8N1, 16, 17);
#endif
version = getVersion();
if (version != 0) break;
OBDUART.end();
}
return version;
}
I can provide more examples from either library, but as of now i'm totally stuck, any help is appreciated!