4

I am able to control the speed and direction of 2 DC motors using an AVR-based microcontroller board (see here for details) currently through hyperterminal (Flash Magic).

Is it possible to do the same through a Java-based GUI program instead?

I mean the speed entered in the textfield of the GUI being sent to the COMPort instead of the one entered in hyperterminal. If so, how?

Connor Wolf
  • 31,938
  • 6
  • 77
  • 137
ABES
  • 41
  • 1

1 Answers1

4

There are com-port libraries available for java.

RXTX seems to be one of the most prominent.
Here is a long discussion about how to use RXTX and an alternative, called JavaComm.
Here is a question on StackExchange asking essentially exactly what you are asking.


Note: I'm assuming you want to write a java application to do what you describe (otherwise, why would the application being java-based be relevant?)

If not, please update your question.


Edit:

If you're in control of the USB-serial converter, you could use the jD2XX library, which wraps the FTDI D2XX driver API.

This is an excellent API, but it will only work with FTDI usb-serial converters.

Connor Wolf
  • 31,938
  • 6
  • 77
  • 137
  • I have used RXTX extensively and it was painful to get everything working just how I wanted. I hope @ABES knows what delays do in a control system. I will admit, getting the first bit started was easy, just getting it fine tuned took time. – Kortuk Jan 23 '12 at 10:35