17
votes
\$\begingroup\$

I would like to start to play with Arduino.

I've read that C and C++ are the official languages but I've also found other way to communicate using Python or Java for example.

Which programming languages are supported to program Arduino?
Are there any limitations using Python or Java?

\$\endgroup\$

locked by Nick Alexeev May 21 at 16:26

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

Read more about locked posts here.

14
votes
\$\begingroup\$

My advice, stick with the C++ derived Arduino language or use raw C/C++. It's ideally suited to microcontrollers. But, if you like esoteric languages:

\$\endgroup\$
  • \$\begingroup\$ I've read that when you buy a shield, it is typically shipped with a C library which is used to interface it with the arduino program. Can these libraries be imported also in those proposed esoteric languages? \$\endgroup\$ – systempuntoout Apr 28 '11 at 18:49
  • 4
    \$\begingroup\$ With some porting work, yes. For interpreted languages, you could port the shield's driver into the interpreter and add calls. For a compiled language, you could add the shield's driver to the runtime. \$\endgroup\$ – Toby Jaffey Apr 28 '11 at 19:00
8
votes
\$\begingroup\$

you can use the language that you feel more confortable, then you can look for a way to compile in arduino code machine. For example I use Go Lang and I use gobot.io to do it working...

Exist Cylon.js if you want to program in JavaScript or Artoo for Ruby developers.

Actually C is the most common because the IDE of arduino work with it.

\$\endgroup\$
  • \$\begingroup\$ No, C++ is the most common. \$\endgroup\$ – Ignacio Vazquez-Abrams Oct 23 '14 at 21:25
  • \$\begingroup\$ the most common is C. \$\endgroup\$ – Careuno Merchan Nov 11 '14 at 19:00
  • \$\begingroup\$ It looks like C, but it is really the C-like subset of C++. As a demonstration, try using __flash in an Arduino sketch. It won't work because the Arduino IDE uses a C++ compiler, whereas a similar program using the C compiler will compile properly. \$\endgroup\$ – Ignacio Vazquez-Abrams Nov 11 '14 at 19:02
1
vote
\$\begingroup\$

You are a bit confused. I would stick with the c/c++ arduino enviroment for the arduino. Java, Python, Processing are used on the pc to run communications with the arduino, they are not laguages for the arduino. One limitation for them is that they do not run on the arduino.

\$\endgroup\$
  • 8
    \$\begingroup\$ I think it may be you that is confused. The arduino doesn't run interpreted code, it's compiled. Code can be compiled from any high-level language that has a compiler for the hardware. \$\endgroup\$ – brianary Jan 4 '13 at 18:35
  • \$\begingroup\$ I second @brianary, this answer is wrong and should be un-accepted to avoid confusing readers. Microcontrollers run compiled code just like microprocessors, any high level language can be used if someone took the trouble of making a compiler for your platform. Some languages like Java and python are not necessarily compiled and may require an interpreter, but as a standard program someone may have made one for your platform. \$\endgroup\$ – Mister Mystère Aug 31 '15 at 7:23
  • \$\begingroup\$ Who said the arduino runs interpreter code. Of course the arduino can run any language there is a complier for, but it can interpret any code that someone bothers to write an interpreter for it. I have not researched this. I just recommended sticking with the standard c/c++ enviroment, and noted that with communications the pc could run a "pc language". \$\endgroup\$ – russ_hensel Sep 1 '15 at 15:22
  • \$\begingroup\$ "if someone took the trouble of making a compiler for your platform". the key answer. Unfortunately the Arduino environment is C/C++ \$\endgroup\$ – Gabe Nemeth May 21 at 14:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.