Serial port

edited April 2017 in Arduino

Hi!

I have a problem with the Serial port. I encounter a problem when I am running Processing program. "Error opening serial port COM1: Port not found" and I trie to use printArray(Serial.list());myPort = new Serial(this, Serial.list()[0], 9600); and the show me this error : ArrayIndexOutOfBoundsException:0 I use Windows 10 and Processing 3.3.1. This problem appeared as soon as I run my processing code. I don't know what to do... Anybody can help to fix this issue? Thanks very much!

Tagged:

Answers

  • What does Serial.list() return? What are you trying to connect to?

    Kf

  • I try to connect the webcam, the Serial.list() return a list of all available serial ports. I tried everything I found, nothing works. Not the Serial.list() is the problem, the Serial.list() was just a try, the problem is that the COM is not found..... When I run the program it gives me the error "Error opening serial port COM1: Port not found", that is the problem I want to solve

  • The Serial.List will tell you what it detects. Those are the options you have to connect. One thing you can do is to compare the output of the serial list when your device is plugged and unplugged. Do you have a difference at all? If you do, then that extra port is the one that is associated to your device. Notice it could be a different port number.

    Or open the device manager and then connect your device. The device manager should show you a new connection and what port it got assigned. That is the port that you need to use. The serial list output will tell you what entry is that port at and it might be useful depending on how you are creating the serial object. You should post your code, or your serial initialization part at least.

    Kf

  • edited April 2017

    An ArrayIndexOutOfBoundsException means that Serial.list() is returning an empty array array. Yet you say

    I tried everything I found.

    That doesn't make sense as you found nothing. Please be more clear.

Sign In or Register to comment.