0

I want to know is there a way to send signals through a USB port using java. I've got an app, which, after fulfilling some conditions should send a signal to a stepper motor causing it to turn for a certain angle. I'm trying to find a way to send a signal on D+ or D- of the USB port so the controller of the motor would 'know' in which direction the motor should turn. Is it possible to do such using the RxTx library? If yes, can anyone provide a simple example of such connectivity?

  • 4
    You cannot send arbitrary "signals" over the USB pins. – Oliver Charlesworth Oct 27 '13 at 17:58
  • 1
    I assume you are using some kind of mikrocontroller to interface with the stepper motor driver. If you want to communicate with this mikrocontroller via USB it must contain a USB device peripheral and you have to setup a USB device class stack e.g. USB CDC ACM. A much easier way is to use a ready to go USB<->Serial converter and a UART peripheral on your mikrocontroller. In both case you can use rxtx to access the port. – Alexander Oct 27 '13 at 22:48

0 Answers0