Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
var serial; // Declare a "SerialPort" object
var proxPin = 0; // Variable from the Proximity Sensor
function preload() {
music = loadSound('youFlyMe.mp4'); //load sound from project folder
function setup() {
createCanvas(600, 400);
serial = new p5.SerialPort();"/dev/cu.AdafruitEZ-Link744f-SPP");
serial.onData(gotData);; //play youFlyMe.mp4
function gotData() {
var data = serial.readLine(); // Read the data as text (a string)!
if (data.length > 0); { // Check to make sure something really came in
proxPin = Number(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment