Serial-sly

Intro to Asynchronous communication lab

FullSizeRender 13

I used two FSRs for this lab. Although everything worked the way I wanted, my biggest take away is that I tend to copy and paste the code into Arduino and then in p5. This is an awful habit as I’m not understanding the actual code, as well as I don’t truly understand why something is not working. The same was true for the second lab: Serial Input to the p5.js IDE. So, to combat this issue I spent more time on related labs.

Below is the board setup for two labs I did with serial.

IMG_2859

Using the board, I programmed p5 and Arduino together. When H is pressed, it’s sent to the Arduino and turns on the light. When the light is on, the Arduino then send a signal back to p5 and changes the color of the canvas background.

Screen Shot 2015-10-14 at 7.19.57 PM

Screen Shot 2015-10-14 at 7.20.36 PM

To practice a bit more, I wanted to use my ICM sketch from last week. When the sketch begins, the light on the Arduino is off and the balloons begin to me. In p5, you must change the color of each ball by clicking inside of each one. Once all of them are clicked, the light will turn on.