Arduino Serial To P5 Generative Sketch

This week I adapted a program I wrote for Visual Language to be controlled by a potentiometer connected to an arduino.

There is a one way serial connection between the arduino and p5, I am sending a byte (between 0 and 255) then scaling by 2 in p5 because the canvas size is 500. The number of squares and the rotation of the squares is determined by the potentiometer value. The colors are randomized using my color pallet from Visual Language every run of the loop.

Sketch & Arduino Code: HERE