Question by
arinozkinay · Dec 10, 2017 at 04:11 PM ·
c#assignnumberserialportserial
Serial: Assigning Ports Ingame
Hi everyone!
I made a little program works with serial port. But the port number will change on target computer.
So is there a way to assign a port number from a text box on start?
Thanks!
Comment
Answer by josiperez · Jan 04, 2018 at 07:52 PM
Hi @arinozkinay,
You also can create a configuration file in StreamingAssets directory (good for standalone environments, or mobile devices), to read the file with this unique information before open the serial and put the content in a variable for use later:
serialp = new SerialPort (serialPortDefined); //colect from configurationFile
I think this should facilitate the user and permit variations on the port names depending on operating system. Well, if it is only one machine, yes, you can do an input in a text box and use its content to assign to the port, similar to catch from a file.