I am a beginner with the Arduino environment and I need some help figuring out how to use some .c source files in a sketch without creating a library. I tried to find the answer on the forum but I couldn't, I apologize if the solution to my problem is somewhere in the posts and I just missed it.
So, I have a test.h file that contains only:
void doSomething(void);
The test.c file contains:
#include "test.h"
void doSomething(void)
{
// there should be some code here
}
In my sketch, I have:
#include "test.h"
void setup()
{
doSomething();
}
void loop()
{
}
I am not sure if this was needed or not but I also went to the Sketch menu and use Add File... to include both .h and .c file.
When I compile I get:
o: In function `setup':
C:\DOCUME~1\coprea\LOCALS~1\Temp\build50525.tmp/Temporary_3386_6704.cpp:6: undefined reference to `doSomething()'
C:\DOCUME~1\coprea\LOCALS~1\Temp\build50525.tmp/Temporary_3386_6704.cpp:8: undefined reference to `doSomething()'
If I understand correctly from the Build Process page, this should work so I am sure I am missing something. Thanks for your help in advance!