• Elvin Ou

Arduino and p5

Updated: Oct 17, 2018

For this week, I have explored the serial communication between p5.js and Arduino. It was a hot mess when I was first trying out the analog input from Arduino to control the graphic in p5. Through the communication there are so many factors that need to be altered for these two system to communicate: the bytes, the language of print/println/read/write/console.log etc. After I finally figure out how to communicate between them, I used one potentiometer that controls the size and rotating speed of one graphic(the rotating triangle) and the quantity of the other graphic.

From there I started exploring how to input two analog controls and it was so difficult for me to translate the two different analog input value into p5 to make different changes for the animation, but eventually I was able to use two potentiometers that control the size and rotating speed of one graphic(the rotating triangle) and the quantity of the other graphic separately. Then I tried to make a really simple game that the two potentiometers controls the movement of a candy to move through the canvas avoiding the pumpkin baskets.

For the midterm group project, Eva and I had a discussion and decided one what we are gonna make. We started with sharing our own thoughts on what we want to do and made a decision on making a candy dispenser that is controlled by a game on p5 that controlled by analog inputs from arduino and then activates the motor to dispense candy from a skull container. There are some sketches of our idea and what we needed as components so far.

and the game: