What programming languages or environments target Arduino or AVR besides the default C++ environment?
PS: I'm using Mac OS 10.5.
The language used is based on C and C++, there are a couple of small differences designed to make Arduinos as easy to use as possible. The Arduino IDE will do some pre-processing to the code to avoid some unwanted errors but other than that it's C and C++.
The most widely used high-level language for AVR microcontrollers is C, so this document will focus on C programming. To ensure compatibility with most AVR C compilers, the code examples in this document are written using ANSI C coding standard.
It's definitely possible to use alternate languages for development with Arduino, just not necessarily using the standard IDE. This is as, at the end of the day, the C/C++ code is assembled into byte-code for the AT-chip on the Arduino board. One language you could use is Céu, a higher-level version of C/C++.
Some commonly known ones:
In theory you should be able to extend avr-gcc to support other languages, though this is no small undertaking. I should also caveat that support for languages other than C typically comes with some fairly weighty restrictions on language components -- for instance, even with C++ it's discouraged to be instantiating new objects as malloc
and free
are extremely expensive in both memory space and cycles.
Besides using Google, the following references are applicable:
An incredibly popular option is to program your Arduino directly in C, versus Wiring (the programming language used by the Arduino IDE). This allows a lot more control over the low-level operation of your microcontroller.
The Arduino IDE supports C (as Wiring is based on C and C++) and compiles with the AVR-GCC toolchain, or you can go without an environment and use a text editor, the command line (with AVR-GCC toolchain installed) and avrdude (a command-line tool available on MAC, Windows and Linux).
AVR devices can also be easily programmed with Atmel Studio (formerly AVR Studio), which can use a multitude of programming languages.
The Arduino forums have a lot of information for programming in C.
Information regarding the AVR-GCC toolchain can be found here.
http://www.nongnu.org/avr-libc/
I personally quite enjoyed taking the hard way around and learning how to program an AVR chip without the IDE, but this comes down to personal preference and how much you want to learn.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With