Arduino -> Java program

Hi all,

I am wondering whether there is any work that has been done on communicating with a Java program through the Arduino. (I did a search of these forums and found nothing).

I work for an open-source educational software company that uses probes to draw graphs and interact with models on the screen. We've done a lot of work with commercial probes interfacing with Java, but it would be great to get this to work with the Arduino.

So does anyone know if this has been done, or how hard it might be to get it to work?

Thanks!

Sam

Yes it has been done. You should be able to find a lot of information here and in the playground on connecting the arduino to Processing. The Processing code is Java.

Thanks for the reply.

What I want to know is whether I can get the Arduino to act as an input to a large existing Java application. I guess I might be able to use Processing as a bridge between the Arduino and the Java program, but that seems unnecessary.

Maybe someone has written a Java library for listening to the data coming into the USB port from the Arduino?

Sam,

Any piece of software that can read/write a serial port -- and Java is obviously one -- can interface with Arduino. There is a large page here that describes how to interface with various packages:

http://www.arduino.cc/playground/Main/InterfacingWithSoftware

Mikal

You could do worse than including the Processing "serial" library in your project - although you may also need to include the Processing core library stuff as well.

If you already know java and all then I would not add the many many megs of processing libraries on top of that just for serial communications. use rxtx directly, like arduino (and many other java folks) do.

http://www.arduino.cc/playground/Interfacing/Java

Are you aware the Arduino IDE is written in Java and communicates with the Arduino? :slight_smile:

--Phil.

Sorry to ask in this topic, but anyone knows how to handle the comunication with arduino (receving data) in eclipse??

thanks in advance

Hmmm. Maybe you need to explain.

ECLIPSE to me is an integrated development environment (IDE) and not a language. It supports JAVA, C++, etc so you would need to say what language you are writing code in... we can assume JAVA since the popular ECLIPSE IDE has a version written "for" Java developers.

The answer to your question might me listed above... use the RXTX library for JAVA.

I already solve the problem, thanks :wink: