PComp Lab: Serial Input/Output

So first, I know it’s just slightly uninspired, my original intention was to do something off the sketch we went over in class but I’m stuck home  (with my first cold of year!) with only two working pots,  and if need be will revisit it later on.

20161016_155628sm

(I was some issues with  my hands soldering Friday– but at least one of them worked!)

And so it was the basic slider, I changed the string line because I wanted it to go fully across instead of stopping halfway.

And the Physical Pixel setup!

20161016_165143sm

And here is the video:

Got a little adventurous and added a second LED, swapped the commands so that ‘G’ turned on the green LED, and ‘R’ the red.

new_code

And then tried my hand at imputing binary/ ASCII to change the LED brightness:

newcode2

Now I had some issues with the code on the p5 end…I couldn’t get it to work.

p5sketch3

Highlighted are the lines, and below are the messages from the console. I mean the program still worked but I would get those lines still. I even added the serialport.js in, made sure the monitor in the Arduino IDE was closed, even tired it with serial port app on and off.

Uncaught TypeError: p5.SerialPort is not a constructor (sketch: line 8)
Uncaught TypeError: Cannot read property ‘write’ of undefined (sketch: line 33)
Uncaught TypeError: Cannot read property ‘write’ of undefined (sketch: line 40)

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.