private void btnPortClose_Click(object sender, EventArgs e) { if (Servo_SerialPort.IsOpen) { Servo_SerialPort.Write(">>CLOSE"); Client_Machines.Reset(); Thread.Sleep(500); Servo_SerialPort.Close(); return; } }
private void SendData() { System.Text.Encoding.Default.GetBytes(tbSpeed.Text); Servo_SerialPort.Write(tbSpeed.Text); }