write to serial port with javafx
<p>i am using jserialComm to communicate between java and arduino.
I want to write a string to Arduino.
this is my way for doing this:</p>

<pre><code>rx = SerialPort.getCommPorts()[q];
     System.out.println(rx.getDescriptivePortName());
   rx.setBaudRate(CONFBAUDRATE);
   rx.setComPortTimeouts(SerialPort.TIMEOUT_READ_SEMI_BLOCKING, 0, 0);
   if(rx.openPort()){
OutputStream out = rx.getOutputStream();
         PrintStream writer = new PrintStream(out);    
}
</code></pre>

<p>Then:
i define this function:</p>

<pre><code>private void writeTX(String command) {

writer.println(command);

}
</code></pre>

<p>When i call this function with a string. nothing happens.</p>

<p>I am receiving data periodically from arduino as well. i think there is a problem in this line of code:</p>

<blockquote>
<pre><code>   rx.setComPortTimeouts(SerialPort.TIMEOUT_READ_SEMI_BLOCKING, 0, 0);
</code></pre>
</blockquote>