// import the Serial library for Processing import processing.serial.*; // create a memory object for the incoming data Serial arduinoIn; // create an array to put the incoming values into int[] inputVals; void setup() { size(400, 1024); // list all available Serial devices (for us to find the Arduino) println(Serial.list()); // connect the memory object to the correct USB device (Arduino) arduinoIn = new Serial(this, Serial.list()[1], 9600); // buffer (store) the incoming data until a '\n' (newline) is recieved // then call the 'serialEvent()' function. arduinoIn.bufferUntil('\n'); } void draw() { background(0); //draw some bars to visualize the incoming values for (int i = 0; i