2 of 3
update link for new arduino code
Those pieces of code are pretty much the same.
If you look at the arduino source code you'll see:
setup();
for (;;) {
loop();
if (serialEventRun) serialEventRun();
}
(I'm not sure what serialEvent()
does)
I don't think you can 'overload' the main
function declaration. Also note that the main function calls init
, which e.g. configures the timers, so millis()
etc. will work.
Gerben
- 11.3k
- 3
- 22
- 34