Skip to content

Instantly share code, notes, and snippets.

Created October 21, 2015 15:59
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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