Lab: Two Way Duplex Communication

Lab Link: https://itp.nyu.edu/physcomp/labs/labs-serial-communication/lab-two-way-duplex-webserial-communication/

PComp Lab: https://editor.p5js.org/ajt521/sketches/dUEBc6m-E

I begin by wiring up the breadboard with one push button connected to digital pin 2 and two potentiometers to A0 and A0 analog inputs.

IMG_7717.HEIC

IMG_7718.HEIC

IMG_7719.HEIC

I proceed to upload the provided code and get the appropriate reading in the serial monitor. The button and potentiometers are both reading out.

Screenshot 2023-10-31 at 6.11.29 PM.png

IMG_7720.MOV

Now time to receive the data in p5, beginning with the WebSerial code and setup code.

Screenshot 2023-10-31 at 6.15.33 PM.png

Screenshot 2023-10-31 at 6.16.30 PM.png

I setup the code as instructed but cannot get the data from Arduino IDE to p5. The Web Serial connection looks correct as far as I can tell. I inspect the sketch code and the HTML code and cannot figure out where my problem is. When I put console.log in the serialEvent function, it will not show any data in the console.

With some help from Yeseul I realized the data wasn't sending to p5 because my serial monitor was open! Here is the working program.

IMG_7724.MOV