xxxxxxxxxx
15
var x = 0;
var serial = new Serial();
function setup() {
createCanvas(400, 400);
serial.gotByte = function (value) {
x = value;
}
}
function draw() {
background(150);
rectMode(CENTER);
rect(x, height / 2, 20, 20);
}