import processing.serial.* ; Serial mP; int value; PFont font; void setup() { //size(600, 600); fullScreen(); // text font = loadFont("kukloitext.vlw"); textFont(font , 40); mP = new Serial (this, Serial.list()[1], 9600); } void draw() { background(255); // prasinos fill(#56ED29); ellipse (width/5, 300, 300, 300); // kokkinos fill(#F00A43); ellipse (2*width/5, 300, 300, 300); // mple fill(#0D2BD1); ellipse (3*width/5, 300, 300, 300); // kitrinos fill(#FAA21E); ellipse (4*width/5, 300, 300, 300); print(mouseX); print("-"); println(mouseY); fill(0); text("Click on a colour to make the light turn on", 600 , 650); text("Yellow makes them all go on/off at the same time", 540 , 700); } void mousePressed () { if (dist(mouseX, mouseY, width/5, 300) <=150) { mP.write(0); } if (dist(mouseX, mouseY, 2*width/5, 300) <=150) { mP.write(1); } if (dist(mouseX, mouseY, 3*width/5, 300) <=150) { mP.write(2); } if (dist(mouseX,mouseY, 4*width/5, 300) <=150) { mP.write(0); mP.write(1); mP.write(2); } }