Recitation 9: Media Controller by Yiwen Hu

In this recitation I applied what we’ve learned in class, the “tint” function which can change the background color of the video. I decided to use the potentiometer to change one value of the RGB.

Step 1: Insert the video. 

As we’ve learned in class, in setup() I wrote myMovie function and access it to the video file. I put the video file in the same folder as the processing’s, but under another folder called “data.” Then in void draw(), I wrote like this:

The tint appears after the myMovie read() if statement. And the image function is to make it appear in the sketch. As for the x, it’s the variable I created to change the color. The x will vary based on the potentiometer value.

Step 2: Let Arduino communicate with Processing 

For this step I refer to the example code in previous class. There’s not many change to it except the number of value and port number. For the processing, I put a setupSerial() in void setup() and updateSerial() in void draw(), which are defined in the following code. Another thing I create is the map function that translate the value of the potentiometer to the x, whose range should be under 255. 

After building the circuits, I run the code and it worked!

Leave a Reply