Unable to send data from Processing to Arduino through ports I'm just beginning to use Processing along side with Arduino and need help linking the two. Just to get started, I just wanted to send a single character (eventually strings) to the Arduino and have the Arduino light up a matrix if the Arduino receives the data.

Here's my code for the Arduino (I'm using an Arduino Uno): 

#include &lt;Adafruit_GFX.h&gt;   // Core graphics library
#include &lt;RGBmatrixPanel.h&gt; // Hardware-specific library

// Set up the matrix
#define CLK 8 
#define LAT A3
#define OE  9
#define A   A0
#define B   A1
#define C   A2
RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, false);

int incomingByte = 0;   // for incoming serial data

void setup() {

  Serial.begin(9600);     // opens serial port, sets data rate to 9600 bps
  matrix.begin();
}

void loop() {
    if(Serial.available() &gt; 0) {
    incomingByte = Serial.read();

    // Print a white "Done!" to the matrix
    matrix.setCursor(1, 0);
    matrix.setTextSize(0);
    matrix.setTextColor(matrix.Color333(7, 7, 7));
    matrix.print("Done!");

  }
}


And here's the code for Processing:

// Example by Tom Igoe

import processing.serial.*;

// The serial port:
Serial myPort;

// List all the available serial ports:
println(Serial.list());

// Open the port you are using at the rate you want:
myPort = new Serial(this, Serial.list()[1], 9600);

// Send a capital "A" out the serial port
myPort.write(65);


I run the processing sketch and then upload the code to the Arduino, but get nothing. The Arduino is using COM3 and I believe the Processing sketch is too, but that may be where I'm messing up. 

If I open up the serial monitor and send some data to the Arduino that way, then the LED lights up fine, but only when I do it through that.

Any help would be appreciated. Thanks!
When you open a serial connection to Arduino Uno the atmega328 microcontroller is usually reset(this depends if the OS is configured to toggle the DTR serial control signal on/off when a port is opened). Just after a reset the bootloader (optiboot) runs to see if you are trying to upload a new sketch. If the bootloader doesn't receive any meaningful communication it will start your sketch after ~1 sec. All communication sent to the serial port while the bootloader is running is lost.

When you use the serial monitor you are too slow to notice the 1 second where the board won't respond to your commands. But the processing sketch is another story.

The easiest fix will be to insert a delay after you open the serial port and before you send any data.

// Wait 1.2 sec
int start = millis();
while (millis() - start &lt; 1200);




If you would rather use a hardware fix you can connect a 10uF capacitor between RESET and GND pins that will prevent the board from being reset by the usb to serial converter.