xxxxxxxxxx
18
let port;
function setup() {
createCanvas(400, 400);
port = createSerial();
}
function draw() {
background(220);
}
function mousePressed() {
if (!port.opened()) {
port.open('Arduino', 9600);
} else {
port.write('!');
}
}