I am working on a asp.net application and I want it to communicate to a arduino board via a serial port. I created a windows application that could do that and it worked, b
Try open connection and close connection on serial port block command. Ex
SerialPort COM = new System.IO.Ports.SerialPort("COM14");
protected void btnRele1_Click(object sender, EventArgs e)
{
COM.Open();
if (btnRele1.BackColor != Color.Green)
{
COM.WriteLine("1");
btnRele1.BackColor = Color.Green;
btnRele1.ForeColor = Color.White;
btnRele1.Text = "Rele 1 - ON";
}
else
{
COM.WriteLine("2");
btnRele1.BackColor = Color.LightGray;
btnRele1.ForeColor = Color.Black;
btnRele1.Text = "Rele 1 - OFF";
}
txtSerial.Text = COM.ReadLine();
COM.Close();
}