Arduino to Processing

Your Arduino MUST be connected to the PC via the serial port which is how they (Processing and Arduino) communicate.

You do not have to plug it into DC power if you are getting enough power from the USB port.

Processing MUST connect to the correct serial port in the code.

This works on my PC with Arduino connected to COM7:

void setup(){
  size(200, 200);
  //println(Serial.list());
  printArray(Serial.list());
  
  //String arduinoPort = Serial.list()[2];
  String arduinoPort = "COM7";
  port = new Serial(this, arduinoPort, 9600);
}

My Arduino in on COM7.

I showed 2 ways to identify the COM port in the code; one is commented out.

:slight_smile:

2 Likes