I'm trying to get my arduino to communicate with a processing program. Every time I do it I get this error:
"Error opening serial port /dev/tty.usbmodem1441: Port busy"
. My arduino is using the same port.
Here is my processing code:
import processing.serial.*;
Serial myPort;
String val;
void setup()
{
String portName = Serial.list()[5];
myPort = new Serial(this, portName, 9600);
}
void draw()
{
if ( myPort.available() > 0) {
val = myPort.readStringUntil('\n');
}
println(val);
}
I got it from https://learn.sparkfun.com/tutorials/connecting-arduino-to-processing and I didn't change anything.