11
\$\begingroup\$

Is it possible to program an Arduino with other languages that aren't C/C++ based? What would be required to do so? I know that other IDE's are available, I'm curious about actual programming languages, like being able to code the Arduino in Python, as an example.

\$\endgroup\$
  • \$\begingroup\$ I've edited the question to clarify that I'm talking about languages, not the IDE. \$\endgroup\$ – nathangiesbrecht Apr 9 '13 at 21:28
  • 2
    \$\begingroup\$ If C# is your thing, check out the Netduino. \$\endgroup\$ – Kevin Mark Apr 9 '13 at 21:30
  • 1
    \$\begingroup\$ @KevinMark There is the slight issue that he might not be able to use a Netduino (needs the added ports of a Mega, for example). \$\endgroup\$ – Polar Apr 9 '13 at 22:21
  • \$\begingroup\$ @Polar I believe the Netduino Go has additional connectivity options. \$\endgroup\$ – Kevin Mark Apr 9 '13 at 22:38
  • 1
    \$\begingroup\$ @powtac String is Arduino specific? I wonder why I have so many in my code then... \$\endgroup\$ – Polar Apr 10 '13 at 12:44
5
\$\begingroup\$

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++. The main issue that you'll have is finding a compiler for your language of choice - at the end of the day, you could write your own - however, this requires an intimate jnowledge of C/C++ anyways. Therefore, it is probably best to stick to C/C++, at least for the time being.

EDIT: You've slightly rephrased your question, so yes, it would be possible to program your Arduino in Python (poor choice of language, though that's just my opinion), but you would need a different IDE / a custom compiler for the reasons above. Also, you would have to be careful when linking libraries written in a different language for the Arduino (as they're all C/C++).

\$\endgroup\$
  • \$\begingroup\$ It really is not possible to run python on the arduino (except the Arduino Mega, anyways). The python-on-a-chip project is working on a compact python runtime, and it needs at least ~8KB of SRAM. \$\endgroup\$ – Connor Wolf Apr 9 '13 at 22:17
  • 1
    \$\begingroup\$ Python is really, really not suited for small, memory-constrained environments. \$\endgroup\$ – Connor Wolf Apr 9 '13 at 22:18
  • 2
    \$\begingroup\$ @ConnorWolf Two points: 1) My use of Python as an example was as it was in the question - I dislike Python anyways. 2) Theoretically, you could convert the Python into C and then you would avoid the need for a Python runtime on top of the bootloader. \$\endgroup\$ – Polar Apr 9 '13 at 22:19
1
\$\begingroup\$

It looks like there currently isn't any way to easily code an Arduino in anything but Assembly/C/C++ (and Céu as mentioned in Polar's answer -- though this is just translated into C++). There are many languages from which you can communicate with the arduino, though.

However, in theory it is not impossible. You just need to write a compiler for the chip and define the built-in functions, and then transmit the compiled code via the serial port. Or you can write a python-to-c++ translator and get that to work.

If you have a penchant for .NET, you may want to check out the Netduino. There seems to be a Java runtime environment for the AVR as well, called the NanoVM. There's also dk-basic for BASIC. I've not tried any of these, though.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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