#define problem!

You should not put variable definitions in a .h file. That will cause multiple definition linker errors if that .h is included in more than one .cpp file (or in the .ino file and another .cpp file). Same is true for regular function definitions. Member functions within a class definition and template functions are a slightly different store.

See My Post #5 in this Thread for a basic guide to improving code modularity by breaking it into .h / .cpp files.

1 Like