//Arduino Sensor Value //the "void serialEvent" is from https://discourse.processing.org/t/use-the-arduino-processing-interface/9409/3 //Mr. H. import processing.serial.*; Serial myPort; int sensorValue = 0; void setup(){ size(600,600); printArray(Serial.list()); myPort = new Serial(this, Serial.list()[3], 9600); myPort.bufferUntil('\n'); } void draw(){ background(255); fill(0); textSize(28); textAlign(CENTER); text("Sensor Value = "+sensorValue, width/2, height/2); } // serialEvent method is run automatically by the Processing applet void serialEvent(Serial myPort) { // read the serial buffer: String myString = myPort.readStringUntil('\n'); myString = trim(myString); println(myString); int values[] = int(split(myString, ',')); if (values.length > 0) { sensorValue = values[0]; } }