Arduino Library Linkage

If I write my program using the Arduino IDE but access the port registers for my target processor directly, do not make use of Arduino classes, functions, etc, and replace loop() with while(1), Will any Arduino code still be compiled into the program.

I ask because I'm using the Sparkfun Tiny AVR programmer to program an Attiny85 and I can only get it to work with the Arduino IDE even though my code is written in "bare-metal" and does not make use of the Arduino library.

It does define main. In which case, can I do without loop()? Is there no way to remove setup?

You must adapt your code to the structure of an Arduino IDE sketch or not use the Arduino IDE. As simple as that.

In theory, if you define main(), it will override the main() in the Arduino code, so none of init(), setup(), or loop() will ever get called, and your binary will have nothing from the Arduino core.

If your bare-metal program doesn't work, something else is wrong, but you need to provide more details for us to have a clue as to what that might be. (What are you using, OTHER than Arduino, that isn't working? What does the program look like? Does your tiny85 have a bootloader like micronucleus? In what way does it "not work"?)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.