private static void Main(string[] args) { SerialPortFixer.Execute("COM1"); using (SerialPort port = new SerialPort("COM1")) { port.Write("test"); } }
private static SerialPort CreateNewSerialPort(ArduinoPortConnectionInfo connectionInfo) { //Address issues in underlying stream opening: http://zachsaw.blogspot.com/2010/07/net-serialport-woes.html SerialPortFixer.Execute(connectionInfo.PortName); return(new SerialPort(connectionInfo.PortName, connectionInfo.BaudRate)); }