Jump to content

Recommended Posts

Posted (edited)

Bom dia,

Estou a desenvolver um programa para comunicar com o meu arduino.

A comunicação funciona 5*.

O problema é que se eu durante o envio de dados para o meu arduino tirar o cabo de comunição ele dá-me uma exceção(erro)

O envio de dados para o arduino está assim.

try
{
 serialPort1.Write(textBoxEnviar.Text); //envia o texto presente no textbox Enviar
}
catch (System.Exception exc)
{
 MessageBox.Show(exc.Message);
 Close();
}

Ele dá me uma exceção no seguinte codigo: serialPort1.Write(textBoxEnviar.Text);

O try catch não sei porque não está a fazer nada.

Obrigado

Edited by apocsantos

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.