I looked at the example at http://www.arduino.cc/playground/Code/Library
and there is some mention there about compiling the .h and .cpp file and an object file that must be deleted if the source is changed. Now, compile with what? I guess the IDE does not generate object files...
I coded a simple .h and .cpp file in notepad then tried to import it into the sketch I have in Arduino IDE 022. Is this not possible?
I get these errors when I try to run the below sketch:
testclass:-1: error: new types may not be defined in a return type
testclass.cpp:3: note: (perhaps a semicolon is missing after the definition of 'testclass')
testclass:-1: error: two or more data types in declaration of 'setup'
testclass.cpp: In function 'void setup()':
testclass:4: error: request for member 'addnum' in 'tc', which is of non-class type 'testclass ()()'
int addnum(int a, int b);
int testclass::addnum(int a, int b)
Somebody please enlighten me!