Week 6: Serial Communciation between p5.js and Arduino
Demo video
This week we explored serial input and output and using serial communication between p5.js and arduino. Using what I learned, I made a small prototype controlling a p5.js sketch with a potentiometer and ultrasonic sensor.
How it works
I reused a p5.js particle sketch I made before to put in my blog's main header.
The arduino code reads and smooths values from the potentiometer, and sends to the p5 sketch using the p5.serialcontrol app and p5.serial library.
The potentiometer's value controls the spinning circles' radius, while the ultrasonic sensor's proximity controls the spinning circles' distance and color hue.