12

I like the idea of using the Arduino IDE for simple projects and for getting started with Arduino, but the consensus I've gotten so far is that it is for those who are new to Arduino and/or programming in general.

My understanding is that it is possible to write a C program from scratch, completely outside of the Arduino IDE, and then use a tool like AVRDUDE to upload it to an Arduino MCU. This option, albeit appealing and interesting, leaves me with a few concerns:

  • What Arduino libraries would need to be imported/linked by such a "raw C" program? I assume that when an Arduino IDE-based program executes a digitalWrite(...) it is really calling a C lib, probably provided by Arduino, under the hood. I am concerned about making sure all these "underlying libs" get included with my C program. Thoughts?
  • Is anything else "lost" by flying solo and venturing outside the Arduino IDE? Any capabilities/features that I would now have to "roll my own"?
smeeb
  • 509
  • 2
  • 10
  • 21

3 Answers3

5

You're absolutely right about needing to link against other libraries. However, you don't necessarily need to worry about all of the details yourself, unless you want/need to do something unusual. Several alternative IDEs already support Arduino, typically via plugins which handle a lot of the details automatically.

I normally recommend Eclipse as it's a very widely used IDE for various purposes. However, there are several other possibilities. See this question for more information:

Peter Bloomfield
  • 10,982
  • 9
  • 48
  • 87
4

Here you are two nice articles how Arduino actually works in background. How it removed friction from microcontroller programming.

  1. A Tour of the Arduino Internals: How does Hello World actually work?
  2. Arduino and GCC, compiling and uploading programs using only makefiles

It was also discussed here Is there a way or tutorial for converting Arduino code to C code?

Michal Foksa
  • 243
  • 2
  • 8
1

Yes, you can write a program outside Arduino IDE. For example I tried Eclipse IDE with AVR plug-in and now I stick with AVR Studio. Of course,you won't have some functions that you maybe usually use when you write in Arduino IDE and also some libraries. But, why not to try implementing stuff. Why to limit yourself to functions and libraries made by others when you can learn and write your owns, maybe better than the existing ones.

23ars
  • 166
  • 8