如何在C#中定义串口
Form1
包含初始化和端口打开语句
_Serial_Interface.PortName = COM16;
_Serial_Interface.BaudRate = 115200;
_Serial_Interface.Parity = Parity.None;
_Serial_Interface.DataBits = 8;
_Serial_Interface.StopBits = StopBits.One;
_Serial_Interface.Open();
(在哪里)
Form2
包含DataReceived
事件。
public void _Serial_Interface_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
}