Physical Inputs
Protoboard read from serial
Setting up your client
- Import the library https://github.com/p5-serial/p5.serialport/tree/main/lib a. to import the library in Processing IDE, copy the file p5.serialport.js inside the libaries folder inside your sketch folder.
Setting up the server
- download https://github.com/p5-serial/p5.serialserver
- Open the terminal and navigate to this repository (cd + drag and drop the folder).
- Install the dependencies with the command
npm install
. - Start the server with the command
node startserver.js
.
To install node on your machine just go on https://nodejs.org/en/ and download the latest version of node.
After this you can run the sketch.
Errors with Node 14 and above
if you get some errors on an M1/M2 mac you might need to revert to version 14 (that works).
Here how to (write these commands on the terminal):
sudo npm install -g n
sudo n 14
xattr -r -d com.apple.quarantine "~/PATH TO P5SERIAL SERVER/p5_serialServer/node_modules/@serialport/bindings/build/Release/bindings.node"
npm rebuild