4
\$\begingroup\$

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?

\$\endgroup\$

1 Answer 1

4
\$\begingroup\$

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.

\$\endgroup\$
1
  • \$\begingroup\$ 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. \$\endgroup\$
    – Kortuk
    Jan 23, 2012 at 10:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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