Communicate with Arduino through the COM4 port

Asked

Viewed 132 times

2

I created a code in c# to communicate with the Arduino uno. He has to pass me what the tag passed by the rfid reader and show in a textbox the value.

I added the serialport1.

Code:

        serialPort1.Open();
        string entrada = serialPort1.ReadLine();
        serialPort1.Close();
        txtIDTag.Text = entrada;

Error when executing:

An unhandled Exception of type 'System.Unauthorizedaccessexception' occurred in System.dll

Additional information: The 'COM4' port does not exist. inserir a descrição da imagem aqui

  • Are you sure that the Arduino is connected to the door COM4?

  • I’m sure yes

  • Did you run the program as an administrator? It may be a lack of permission, apparently.

  • Thanks for trying to help Anderson, I found the problem. The door was being used by another application.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.