This should be a simple problem. I'm trying to split up code into two files within a sketch:
test.ino:
void setup(){}
void loop(){ fn(); }
test.c:
char myChar = '?';
void fn(){ myChar++; }
I've tried using a test.h file with various configurations such as having the lines:
extern char myChar;
,char myChar;
void fn();
extern void fn();
And various combinations of including test.c and test.h files in the different files, but I always get one compiler error or another, such as:
test.cpp.o:(.data.myChar+0x0): multiple definition of `myChar'
test.c.o:(.data.myChar+0x0): first defined here
Or
test.cpp.o: In function `setup':
C:\Program Files\arduino-1.0.4/test.ino:4: undefined reference to `fn()'
I'm really pulling my hair out with this one. Any help would be greatly appreciated