Week 9
|
This week, we learned about two-way serial communication between the Arduino and p5.js.

I followed the lab and put in the code to p5.js and the Arduino. I had to mess with the Arduino code a little bit to get it to do the handshake and send me data when I asked for it. This was the resulting code:


After getting that fixed, I was able to control the circle in p5 with my potentiometers and pushbutton. 


I understand how this works on a high level, but I definitely need to do some more review of the p5 code to see how I can manipulate the sketch further. The serialEvent() function confuses me a little bit, and I’d like to explore more into the p5 code to see how I can apply the handshake to future projects. I’m planning on doing two-way communication for my final project, so I think this is something I’ll be practicing going forward.