Re: Servos, Ardunios, and JMRI #arduino

Bob Jacobsen
 

I think those changes will do it.

Another approach would be to pass the output stream into the listener objects, so that two separate copies of the class wouldn’t be needed.

Bob

On Jul 24, 2019, at 1:21 PM, Geoffb <@Geoffb> wrote:

If :
# get I/O connections for later
inputStream = port.getInputStream()
outputStream = port.getOutputStream()
...
outputStream.write(event.source.userName)
outputStream.write(",0")
...
outputStream.write(event.source.userName)
outputStream.write(",1")

were changed to
# get I/O connections for later
inputStreamPT = port.getInputStream()
outputStreamPT = port.getOutputStream()
...
outputStreamPT.write(event.source.userName)
outputStreamPT.write(",0")
...
outputStreamPT.write(event.source.userName)
outputStreamPT.write(",1")

and
# get I/O connections for later
inputStreamST = port.getInputStream()
outputStreamST = port.getOutputStream()
...
outputStreamST.write(event.source.userName)
outputStreamST.write(",0")
...
outputStreamST.write(event.source.userName)
outputStreamST.write(",1")

would these changes be enough to solve the problem?
--
Bob Jacobsen
@BobJacobsen

Join jmriusers@groups.io to automatically receive all group messages.