import processing.serial.*; Serial port; String portname = "/dev/ttyS8"; int value; int c=0; int angle; void setup() { size(320, 370); port = new Serial(this, portname, 57600); PFont police; police = loadFont("FreeSerif-48.vlw"); textFont(police,48); smooth(); } void draw() { if (0 < port.available()) { value = port.read(); println(value); } fill(0,0,0); rect(0,0,320,370); fill(255,255,255); angle=(value*16/10); text(angle+" °",120,45); fill(192,128,255); text("S",140,90); text("N",140,350); text("E",10,220); text("O",280,220); fill(255,0,0); translate(160, 200); rotate(radians(angle)); rect(0,0,100,10); }