import controlP5.*; import processing.serial.*; Serial port; ControlP5 cp5; PFont font; void setup (){ size(400, 400); printArray(Serial.list()); port = new Serial(this, "COM17", 9600); cp5 = new ControlP5(this); font = createFont("calibri light bold", 13); cp5.addButton("rightLed") .setPosition(25,50) .setSize(100,80) .setFont(font) ; cp5.addButton("leftLed") .setPosition(150,50) .setSize(100,80) .setFont(font) ; cp5.addButton("alloff") .setPosition(275,50) .setSize(100,80) .setFont(font) ; } void draw () { background(128); fill(0,255,0); textSize(15); textAlign(CENTER); text("SERVO & LED CONTROL", 200, 30); int mouse = mouseX/2; String degree = mouse+"°"; textSize(42); textAlign(CENTER); text(degree,400/2,400/2); } void rightLed() { port.write('r'); } void leftLed() { port.write('l'); } void alloff() { port.write('f'); }