The fellow said he was using Arduino 0018, so I just tried it and it works. I posted the following:

Quote

Holy Poop! It does compile in Arduino 0018.

This is not a quibble because it doesn't compile in earlier versions and this is major news to me. I need to investigate this further, but if the Arduino has done away with their earlier way of doing things such that regular C code compiles okay, then I'm in deep doo for reasons irrelevant to this thread. I know this isn't your issue, but tomorrow I'll try to see how this uploads and behaves on my Arduino and maybe I can help you with the specific issues you mention.

BTW - I've seen your error messages before when I didn't properly sync pressing the reset button with starting AVRDude. What I do is get the AVRDude script ready to run, press the reset button on the Arduino then immediately hit the return button to run AVRDude. The Arduino board sends a pulse on the DTR line to reset the Arduino just before it calls AVRDude so that happens automatically, but since you are building your own board, you'll need to do your own reset.

Sorry, for the confusion.

Smiley

I hope somebody here knows more about this. It seems I've missed a big issue.

Hi,sometimes I am really surprised how creative are people in misusing tools/software/whatever. 8-)

Ok, there is a little problem with this. Replacing/overwriting main() has a few sideeffects. The Timers-functions (PWM)/Analog RW and HardwareSerial provided by the Arduino-code are not initialzed. Put a normal delay(1000) call into the sketch-code and it will stop working at this point.The setup() and loop() functions are also not called automatically any more.

There are many non-Arduino programs made for ATmega architecture (no setup, no loop, just a main) that I would like to use in the Arduino IDE. Being able to replace the built-in main() is a good thing, but as noted, there are some minor issues.

From David Mellis:Quote:>> The reason it's not supported is *because* it might change. It> happened as accidental by-product of other changes and could disappear> in the same way.>

This means that if you are going to use the Arduino you should only use code in the Arduino format. That is no main() function and you use setup() and loop() instead. The main function is added to your code and has an ioinit() function before calling setup() and loop(). If you use this accidental bypass then the Arduino ioinit() won't get called and the Arduino library functions might mess up in unpredictable way.

Bottom line:1. Don't use code with the int main(void) function in it.2. Do read the Arduino introductory materials.3. Only use code in the Arduino Sketch format.