ok once more!
I have a new project consisting of one file (for the moment) and its called 'slave'
it is in the following folder path:
C:\Users\harrison\Documents\Arduino\RSS\slave
my init() function just sets things up..
and its call by loop()
void loop()
{
long packinfo = 0;
int radioid;
init(); /* call init to set things up */
for(radioid = 0;
blah, blah, blah
but I get this stupid error:
core.a(main.cpp.o): In function main': C:\Arduino\arduino-1.0\hardware\arduino\cores\arduino/main.cpp:11: undefined reference to setup'
duh???
what in the world..
HELP Thanks
Cris H
This is Arduino 1.0 on Windows 7(64bit Ultimate)
phoenixcomm:
Thank you.. works now.. I called my 'setup' function init and I called from my loop().
That doesn't make sense.
As I understand it, you must have at least the two following functions to make the Arduino program compile correctly:
void setup()
{
}
void loop()
{
}
Without them it shouldn't work (shouldn't being the key word). What el_supremo was saying is that you should call your init() function from the setup function like so:
void setup()
{
init();
}
If it is simple enough, you can just put your initialize activity inside the setup function. If it is complex or you will need to call it later, starting up an LCD for example that might be turned off by the code and needs to be re-initialized at some point, then your init() is a separate function and could be called from setup(). If you call init() from your loop, then you will call it repeatedly unless you use a state variable which adds unneeded complexity except in certain situations like the LCD example where a state would make sense.