【发布时间】:2015-12-15 12:44:22
【问题描述】:
我使用 Unity 和 teensy 进行串行通信已经有一段时间了。它一直运行良好。 现在我更换了我的小板,因此它的 COM 端口也发生了变化。 Teensy 在 arduino 中完美通信,并在串行监视器中检查时发送所有正确的信号。但是我在统一中遇到了这个错误。
> IOException: The port `COM11' does not exist.
System.IO.Ports.WinSerialStream.ReportIOError (System.String optional_arg)
System.IO.Ports.WinSerialStream..ctor (System.String port_name, Int32
baud_rate, Int32 data_bits, Parity parity, StopBits sb, Boolean dtr_enable, Boolean rts_enable, Handshake hs, Int32 read_timeout, Int32 write_timeout, Int32 read_buffer_size, Int32 write_buffer_size)
(wrapper remoting-invoke-with-check) System.IO.Ports.WinSerialStream:.ctor (string,int,int,System.IO.Ports.Parity,System.IO.Ports.StopBits,bool,bool,System.IO.Ports.Handshake,int,int,int,int)
System.IO.Ports.SerialPort.Open ()
最初,com 端口是个位数的值,例如 COM4 或 COM8 等。但自从我开始使用两位数的 COM 端口后,我开始面临这个问题。如果我再次用一位数的 com 端口连接一个 teensy,它可以正常工作,但不会检测到 COM50 等。
我该如何解决这个问题?
【问题讨论】:
标签: unity3d serial-port