프로세싱으로 시리얼 통신하기
import processing.serial.*; Serial myPort; String myString = null; int angle; int distance; void setup(){ myPort = new Serial(this, "COM14", 9600); } void draw(){ } void serialEvent(Serial p){ try{ myString = p.readStringUntil('.'); if(myString != null){ String[] list = split(myString, ','); angle = int(list[0]); distance = int(list[1].replace(".","")); print("Angle : "+angle); println(" Distance : "+distance + "cm"); } }catch(Exception e){ } }