Re: Servos, Ardunios, and JMRI #arduino

Geoffb
 

Bob, et al.,

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?

also Bob, your comment:
This script creates internal Turnout objects with names at start with AT and ST. Although it woks for you now, there’s no guarantee that always will. Better would be names like ITAT or ITST, which are the standard form and won’t (possibly) break in the future.
Uses ATxx and STxx as the User names for the internal Turnout objects or they could refer to hardware objects. I would think that User names as an independent alias for internal or hardware references would be "protected" as a system design  feature of JMRI in the future, as it seems to be "advertised" as such (as consistent in future releases)?
No?  Did I misunderstand?

Have fun!  :-)
Best regards,
Geoff Bunza
scalemodelanimation.com

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