Hi
I’m trying to write my own code and I need to write some functione to different .cpp and .h files. So my sketch is made by the main file (a .ino one, the web IDE created it for me when I choose to start a new project) with an include for the new .h file with the declaration of functions and variables I need. The same include is inside the .cpp file that contains the functions definitions.
Now the problem: when I try to verify my code, the compiler say that all the variable are double defined and abort.
I try to use #ifndef / #define / #endif statements to have a single inclusion of .h file, but it doesn’t solve the problem.
#playground.ino:
#include "lmt871.h"
... my code ...
#lmt871.cpp:
#include "lmt871.h"
... my code ...
#lmt871.h:
#ifndef LMT_H
#define LMT_H
... variable and function declarations ...
#endif
Anyone can help me?
Thanks
P.S. I read about that #include “application.h” thing, but adding it on every files doesn’t solve the problem.