private void openClose(object sender, EventArgs e) { if (arduino.isConnected) { arduino.Close(); } else { arduino.Open(); } }
private void btnConnect_Click(object sender, EventArgs e) { if (_btnConnect.Text == "Connect") { arduino.Open(); } else { arduino.Close(); } }