I have several different sensor libraries for a common sensor… and I have several different sketches that use the same sensor. My question (finally) is how do I organize or use the different Lib’s to avoid compile time errors in trying to compare functionality vs code size or just because I’m too lazy to rewrite all the different prior
code ‘sketches’ for a common library.
My solution so far has been to place the
class library in the sketch… folder, copied from the library that resides where it should \sketchbook\libraries… and use #include “XXX” instead of #include
More specifically in this case (there are several others) I have 3 different ‘lib’s’ for the DHT sensor and in an effort to evaluate them for functionality and code size because I am interested in the Tiny’s I ran into a confusing ‘brick wall’.
Is my solution the correct one or is there a better method for using multiple common sensor lib’s in different applications.
In writing Arduino applications when I get a piece of a sketch that can serve as a ‘module’ I do just that. I save the ‘module’ and use it as a function in future applications of the sensor involved.
The real issue manifests itself when I write a new sketch involving a different lib for the same sensor. In this case it’s the DHT sensor but there are several different other sensors that create the same conflicts at compilation time due to multiple lib’s with common file names.