First hello to all, I’m brand new to this community!
So forgive me if my questions are basic.
I tried to find answer with a search, but did not find.
As a first attempt, I wish to link an ARDUINO and Processing, using the code found in Sparkfun.
Here is my setup (of course serial library and all other variable have been initialized): myPort = new Serial(this, Serial.list()[9], 9600);
I checked in the Reference, and this is how a port should be initialized.
And here, the error I get: ArrayIndexOutof BoundsException: 9
As far as I understand, the port#9 is not recognized, although it is used by my MEGA.
I tried to input other serial ports numbers, but all ports above 6 (that means 7 and further) are rejected, although they are valid, as I use them for other application.
Is there a limitation on port numbers?? If this is the case, I found no mention in Library docs.
Hi, I am also new to this forum. I did this same exercise over the weekend. My Arduino was on COM3 on my computer. I used [0] to connect. If you use debug and look at the Serial.list()[0] then Serial.list()[1] etc. Then use prntln to print these values you can find the correct port. I am still learning this but hope this advice helps.
Did you solve your problem? First thing I will do before I open any port is to print the list of ports P3 sees:
println(Serial.list());
A neat trick is to run this code before you connect your arduino and then run it a second time after your arduino is connected. You wil be able to see what port your arduino is using.
OK, but anyway, you have to upload the ARDUINO program in the board, so you know the used port, as you have to configure it with Arduino tools in the IDE…,