Include library conflicts: How to check for it?

I wonder if it is possible that two or more libraries can not co-exist in a project? In a MEGA project I don't have any obvious pin conflicts but once I put it all together I see some odd behavior. At the moment I am checking and re-checking all parts of the code but I would like to know what the situation is with the include libraries. I think I read somewhere that if libraries share the same timers there could be timing errors. If that is the case, it might be what I am experiencing, what is the best way to check if a library can co-exist with another library?

In my MEGA project (no millis() delays used) all parts work on their own in debugging tests. But when I combine it I run into problems. Could very well be a bug in my code (still going over it) but since I am new to this I would like to understand what I have to do to make sure that two libraries can work together without timing conflicts etc. Thank you!

Below are the include statements in my code for the MEGA.

Thank you!

#include <RCSwitch.h> // 433 MHz
#include <Wire.h> // RTC
#include "Sodaq_DS3231.h"// RTC
#include "TinyGPS++.h" // GPS
#include "SoftwareSerial.h" // GPS
#include <TimeLib.h> //
#include <Adafruit_SSD1306.h> // OLED
#include <SPI.h> // SD
#include <SD.h> // SD

Just look at the library code to see if there are timer conflicts. You have all the sources.

I see some odd behavior.

Describe it, post example output, and perhaps someone on the forum could guess the problem.

The MEGA has multiple hardware serial ports. So, right off the bat, you can get rid of SoftwareSerial and use one of those.

It's hard to know whether libraries will conflict. Anything that uses hardware timers has a possibility of conflicting with other libraries that use them. Servo and softwareSerial is an example. Googling for the libraries and the word conflict may get you somewhere, but if you're using something obscure, that may not help. Then you're left with reading the code as a last resort.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.