如图,今天自己写了段代码实现串口通信,让外设与GH互动。。目的倒是实现了,只是一运行就会很卡,断开外设就正常了。。。大神们看看是不是代码有问题[mw_shl_code=applescript,true] System.IO.Ports.SerialPort sp = new System.IO.Ports.SerialPort();
sp.PortName = "COM3";
sp.BaudRate = 9600;
sp.Open();
int val = sp.ReadByte();
A = val;
sp.Close();[/mw_shl_code] |