2

Is there a way to send and receive messages over the comm ports on a computer using java? I have an arduino listening on a usb port for messages. I would like to talk to it via a java gui instead of the arduino processing gui. What are some ways i can achieve this? C# works too!

Mohammad Adib
  • 788
  • 6
  • 19
  • 39
  • There is no built-in capability like in c#. [see this discussion][1] [1]: http://stackoverflow.com/questions/2121508/how-to-access-usb-ports-in-java – baby boom Jun 05 '12 at 16:30
  • java has very few built in capabilities, but almost anything can be _added_ in. That's what makes it so powerful. (Note: I am by no means trying to start a war over my language is better than your language) – cstrutton Jun 07 '12 at 17:14

5 Answers5

1

I wrote app for arduino in java using RXTX lib. You can read many tutorial both on RXTX home site and other. For example: http://arduino.cc/playground/Interfacing/Java http://rxtx.qbang.org/wiki/index.php/Examples

user902691
  • 1,149
  • 4
  • 20
  • 46
0

jUSB might be what you are looking for.

GETah
  • 20,922
  • 7
  • 61
  • 103
0

"JavaComm" works pretty well as long as you're on a supported platform (such as Solaris). Do you have operating system requirements?

Brian Knoblauch
  • 20,639
  • 15
  • 57
  • 92
0

I was just reading through this site and thought this little gotcha might bite you as you start experimenting. Basically whats happening is that the arduino resets automatically every time serial communications are initiated. This site describes the problem in detail and gives several workarounds depending on your skill and/or comfort level. Have fun hacking.

cstrutton
  • 5,667
  • 3
  • 25
  • 32
0

@GETah I pretty sure that ardruino just uses serial through the usb port. It still creates a COM port through the usb connection to the ardruino.

Zapnologica
  • 22,170
  • 44
  • 158
  • 253