I'm fairly competent in programming including the Arduino IDE and have written several Arduino libraries. For compile time options that are already built into the library, I want to set those options with a #define in the sketch (not the library). But, for the life of me I can't figure out how I should be doing this. I've got to imagine it's possible. Basically, I want to do something like this:
And the #define COOLLIBRARY_SET_SOMETHING will allow me (at compile time) to choose different compile time options in the library. Obviously, the library itself will be something like this:
/* Some library stuff */
#if defined (COOLLIBRARY_SET_SOMETHING)
somevalue = 2;
somevalue = 4;
/* More library stuff */
So, any way to set a define in a sketch so that the library knows about it. Just adding it in the sketch (before or after the library include) doesn't work. Any trick? Just not possible?