I still do not get the relationship between Arduino IDE and C/C++: does programming in the Arduino IDE equals plain C programming or not ? In the latter case, what's the difference and what are the advantages to program in C/C++ ? Is it possible within the IDE ? Is there a tutorial somewhere ?
I still do not get the relationship between Arduino IDE and C/C++
The IDE is a development environment that combines a text editor and access to the compiler, linker, and uploader in an easy to use method.
The language used to program the Arduino is C++. C++ is a superset of C, adding classes and changing the behavior of strcuts in subtle ways.
does programming in the Arduino IDE equals plain C programming or not ?
Yes, and no. There are things that the IDE does for you, like creating a main() function, calling init(), setup(), and loop(), adding include statements, and creating function prototypes for your functions. Other than that, the IDE does not alter your C/C++ code.
what are the advantages to program in C/C++ ?
The biggest advantage is that C/C++ is the only language you can program the Arduino is (except assembler, if you are really strange).
amundsen:
I still do not get the relationship between Arduino IDE and C/C++: does programming in the Arduino IDE equals plain C programming or not ?
Yes, but rather one uses the full gcc C/C++ language. What many (not so aware people) refer to the arduino language are just arduino written C and C++ functions and classes that can be used or not used as you wish.
In the latter case, what's the difference and what are the advantages to program in C/C++ ? Is it possible within the IDE ? Is there a tutorial somewhere ?
Question does not apply, one uses C/C++ already when writing the source code, called a sketch of all things. ;)
Thank you in advance.
amundsen:
Does this means one can import C++ (non-hardware related) libraries to extend the language ?
Absolutely. I have imported a "big number" library for example, and also a regular expression parser. In both cases the changes needed for the Arduino environment were pretty minimal.
Again, as PaulS says, remember you only have 32 Kb of program space, and 2 Kb of RAM on the "normal" Uno and similar. Don't get too carried away.
Arduino uses a version of GNU-GCC adapted for Atmel AVR microcontrollers. There are hardware-specific extensions such as direct register manipulation and ISR definition, and there are a few standard C++ facilities that are not available, e.g. the new and delete operators are not implemented. Good reading here: http://www.nongnu.org/avr-libc/
At one point, was not a good chunk of the floating point library omitted?
Well, sprintf() can't handle the %f format specifier. I'm sure that there are a lot of things that are missing. You'd have to have a need for those things, and an understanding of why they are not present, to develop a workaround, or decide that the project and platform are not compatible.
The parts that are relevant to the hardware do. Things like fopen() don't, but, the Arduino doesn't have a file system, so why should it?
Yes, you and I realize that, but the original poster hopes to move "existing" software from somewhere to the Arduino. Depending upon the Standard C/C++ features used that may not be possible - thus my comment.