import processing.serial.*; Serial port; int height = 320; int width = 480; int x; int y; int z = 16; void setup() { size(width, height); println(Serial.list()); port = new Serial(this, Serial.list()[1], 9600); x = width/2; y = height/2; colorMode(RGB, 255); PFont font; font = loadFont("Myriad-Web-24.vlw"); textFont(font); } void draw() { background(255); fill(128,128,128); text("Press a number between 1 - 9.", 24, 300); fill(0,0,0); text("Receive", 64, 60); fill(0,0,0); text("Send", 256, 60); fill(197,250,197); rect(64,64,80,64); rect(256,64,80,64); while (port.available() > 0) { int inByte = port.read(); println(char(inByte)); // flash receive box fill(0,255,0); rect(64,64,80,64); } } void keyPressed() { int k; int i; k = int(key); if(k < 58) { port.write(k); println("SENT:" + k); // flash send box fill(0,255,0); rect(256,64,80,64); } }