Languages for programming the Arduino

Hi!

Just want to know, if there is only the possibility to program the Arduino-Board with the IDE which i can download on the Arduino-Site.
Or can i use plain C-Code? And how could i programm the board with c only (What do i need)?

Thanks!

If your question is: 'can sketches be written in the C language? then the answer is yes. The compiler used in the Arduino environment is fully C compliant. There are a few minor things to be aware of (such as your code is not providing the main() function) and you can find more info about this if you read the article on the Arduino BuildProcess.

If you are asking if you can write, compile and upload code without the Arduino IDE then the answer is also yes. But unless you already have some other IDE that you favor and some technical expertise to get the makefile modified, I would start out using the Arduino IDE, knowing that the code can be moved over to another IDE later on if you really need to do that.

So, if you need object-oriented programming, you’ll need to move to another language, won’t you?

The Arduino IDE uses C and C++.

There is a gnu C/C++ compiler for the Atmel AVR range of microcontollers. The Arduino IDE uses this simplifying its setup.

You can use the same compiler if you know how to set it up and write and use code for the Arduino boards.

Mike

There’s the problem. I haven’t done it yet. Do you know if there’s a tutorial or workthrough for doing it?

So, if you need object-oriented programming, you’ll need to move to another language, won’t you?

You can write and use object oriented code with the arduino without making changes to the environment. Create your C++ classes with the .h and .cpp files in the same directory as the main sketch. You can create the files in the IDE by clicking on the arrow icon to the right of the tab indicator. There are some restrictions on the C++ implementation used in the Arduino compiler but you can certainly derive and create classes with public and private data and methods.

What was it you wanted to do?

Actually yes. The problem i get is Arduino telling me something like:

“error: ‘Flat’ is not a name type”.

Flat is a class that i created with the “new tab” button.

(…a few minutes later…)

Now i’m trying with the .cpp and .h files (with other problems, now), and i see that the C++ code can be implemented.

Thanks.