xxxxxxxxxx
17
function setup() {
createCanvas(400, 400);
port = createSerial();
connectBtn = createButton('Connect to Serial');
connectBtn.position(20, 20);
connectBtn.mousePressed(() => {
port.open(115200);
connectBtn.remove();
});
}
function draw() {
background(220);
let str = port.readUntil("\n");
console.log(str)
}