Lab 8: Arduino and P5
- Chandler Zastrow
- Nov 15, 2016
- 1 min read
In this lab we utilized both Arduino and P5 in order to send values serially between the two, as well as visualize the data we were sending.
The first portion of this lab involved building a circuit with an analog sensor. We coded a slider and were able to make an led illuminate by way of moving the slider and increasing the brightness of the light.
We then utilized a potentiometer and then wrote Arduino and p5 programs to read between the two in order to visualize that data. In my lab I decided to create a rectangle with p5, with the code allowing me to move it side to side.
The second portion of this lab just involved adding another sensor to control our visualization, so I added a second potentiometer that allowed me to move the previous rectangle up and down. With all of my code, I was able to move my rectangle at any point across the canvas with my double-potentiometer setup.
Below is a video of the first portion of the lab:
and here is a clip of the second:
and below is both the p5 and Arduino code for the lab:
Again, had a good time and learned a lot about p5. What a rush.
Comentarios