import processing.serial.*; Serial myPort; String data="" ; PFont myFont; Serial serialPort; void setup() { size(1500,700); // window size myPort = new Serial(this, "COM11", 9600); myPort.bufferUntil('\n'); } void draw() { background(#0B0B0B); // background color code textAlign(CENTER); fill(#FFFFFF); // data color text(data,710,400); // the numbers is data location textSize(100); fill(#FF85C6); // text color text("It's cm away !",870,400); fill(#FFCCCC); text("UltraSonic Sensor",450,100); } void serialEvent(Serial myPort) //important for the data { data=myPort.readStringUntil('\n'); //important to display the data }