We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I run Listing 6-6. in the Processing IDE. But the IDE keeps reporting "Error opening serial port COM3: Port not found". I think its wants me to put the serial library into the same directory with the code directory. But I dont know how to find the serial library, to copy it to there. Please help
Answers
Please provide your code and any relevant links.
Kf
The code segments below come from Exploring Arduino Chapter 6. The Aruino code is Listing 6-6, and the processing code is listing 6-7. I run Listing 6-7. in the Processing IDE. But the IDE keeps reporting "Error opening serial port COM3: Port not found". I think its wants me to put the serial library into the same directory with the code directory. But I dont know how to find the serial library, to copy it to there. Please help, I am brand new to Processing.
Here is my Arduino code
@Rocketman have you run an arduino sketch before? If you open the Arduino IDE (As described in arduino.cc website), it should tell you what com your arduino is.
I am going to guess your problem is that you are trying to open the wrong serial port assigned to your arduino. Are you sure you are opening the right port. One easy way to check is to run the next code twice. The first time, ensure your arduino is not connected. Check what ports are listed. Then, connect your arduino and run the code again. If you compare the listed ports, you will see the extra port in the second call corresponds to the serial port assigned to your arduino.
N.B. If the above code works, then your serial library is properly installed and you do not have to move it or make any changes
I suggest you check any quick start guide working with arduinos online. They will do a better job desribing how to setup your arduino unit. For you, it is important that you know what serial port is being assigned to your device before you try talking to it.
Kf
kfrajer: The Arduino IDE can show print coming in over the USB from the Arduino, and it shows up on COM3. I wanted to use Processing so that I can do graphics with the data reported. So I am sure its COM3 because of that.
Are you running the serial monitor concurrently with your Processing sketch?
If you can see data through your serial monitor, you should be able to get data in your sketch. However, make sure you close your serial monitor as it occupies the com port.
Kf