Arduino & Java code

Dears,

can i use the Java Code to program the Arduino using java API?

Thanks & Regards.

The Arduino does not have enough RAM to host the Java runtime environment, afaik.

You can program an Arduino in any language you like as long as it's C++ (paraphrasing Henry Ford).

...R

Arduino IDE language is very similar to Java. So you don't need Java to program Arduino. However if you are interested in Java API because its strength you can use my open source java project called Ardulink. BUT Ardulink runs on a PC that control Arduino. So your java application will not run directly on Arduino. The good news are that:

  • you can use a very powerful PC to write and run (and debug) a very complex code and an Arduino just to write to or read from pins.
  • you can use even small PC as Raspberry PI to run Ardulink

Arduino IDE language is very similar to Java

The language used to program the arduinos is C/C++. It is not in the least "similar" to java.

Mark

It is similar in the way that java is derived from C++, both imperative object oriented programming languages, they both use a lot of {}, they both end lines with a ’;’, and the ‘if’, ‘while’, ‘for’ statements are basically the same. The list of differences is so big i won’t even know where to begin.

Yes,

if you prefer Java is similar to C++ (I had developed in C++ first than SUN begins to think to Java).

But I think for this topic that is not possible (or is very very difficult) to program directly Arduino in Java. It’s better to program a PC with a JVM and let the PC to drive Arduino.