[SOLVED] Can we somehow use #define like this...

so this is a generic question as I am not sure if its really possible.

so as in all libraries you can expect to find #define's

for example #define MAX_ARR_SIZE 255

would is be possible to do this in the library

#ifndef MAX_ARR_SIZE
#define MAX_ARR_SIZE 255
#endif

so that in my sketch I can use another #define like this

#include"dummy_lib.h"

#define MAX_ARR_SIZE 25 //basically redefining MAX_ARR_SIZE

//
//
//rest of code

possible?

Your second example is missing the #define.

Basically, yes. Look at the Dallas temperature sensor library. That has some options that can be selected with #define.

But you have to put the #define above the #include for it to be visible to the included code.

MorganS:
Your second example is missing the #define.

Oops! Fixed it on the post! :wink:

MorganS:
Basically, yes. Look at the Dallas temperature sensor library. That has some options that can be selected with #define.

But you have to put the #define above the #include for it to be visible to the included code.

That's Awesome! and exactly what I needed to know... Thanks again.