15

Can I program my Arduino using any programming language other than C++? If so, which programming languages? What software would I need for compiling and loading my code onto the Arduino?

gary
  • 103
  • 5
tstew
  • 729
  • 1
  • 6
  • 26

5 Answers5

9

In theory, any compiler which outputs AVR assembly could be used (modulo limitations on code size, ram usage etc).

AVR backends exist for both LLVM and GCC -- so in theory, with some effort, most languages which are supported by LLVM and GCC's front-ends could be compiled to AVR. A big question will be library support, etc.

Never the less, here's a couple of odd choices for the spirit of the question, rather than its letter [1].

  • AMForth, a forth dialect can be flashed onto an Arduino.
  • AVR-Ada: Ada for AVR micro-controllers.
  • BASIC: Bring back the Goto!

Oh, and you could write raw AVR Assembly!

[1]- I Haven't tried these though!

Matthew G.
  • 670
  • 4
  • 7
5

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 Click Here.

Hardik Thaker
  • 1,407
  • 2
  • 12
  • 15
2

There are also some people working on Javascript node.js based systems. One that is already publicly available is Espruino and another is Tessel which launches in spring 2014.

Matthew R.
  • 121
  • 2
2

I'm surprised that nobody has mentioned AVR Assembly!

Assembly is not often thought to be the most interesting, or even an easy method of programming, but it's nonetheless, 100% possible with all AVR based arduino. SAM boards will likely not work with this flavor, but it's still possible to use assembly in their programming.

All Arduino boards (as of posting) support assembly programming via Atmel Studio, The SDK made for Atmel based chips.

Assembly is naitively supported by all Atmel devices, and requires no boot loader in order to work, so all programs are inherently real-time.

tuskiomi
  • 205
  • 1
  • 11
1

Because avr-g++ should support all standard C / C++ constructs it is possible to code inline assembly. More info on this arduino.cc forum thread

Faux_Clef
  • 199
  • 14