Processing
During the recitation, I used the potentiometer to control the speed of the video. Since I only need one value from the potentiometer, I use the one value sample code. During the process, I first have difficulty putting the video in my data folders, but later I found that I actually download the wrong format of the video. It should always be .mp4 or .mov. Here are the codes:
import processing.serial.*; import processing.video.*; Movie myMovie; Serial myPort; int valueFromArduino; void setup() { size(240, 426); background(0); printArray(Serial.list()); // this prints out the list of all available serial ports on your computer. myPort = new Serial(this, Serial.list()[ 3 ], 9600); // WARNING! // You will definitely get an error here. // Change the PORT_INDEX to 0 and try running it again. // And then, check the list of the ports, // find the port "/dev/cu.usbmodem----" or "/dev/tty.usbmodem----" // and replace PORT_INDEX above with the index number of the port. myMovie = new Movie(this, "Lilly.mp4"); myMovie.loop(); } void movieEvent(Movie movie) { myMovie.read(); } void draw() { // to read the value from the Arduino while ( myPort.available() > 0) { valueFromArduino = myPort.read(); } println(valueFromArduino);//This prints out the values from Arduino image(myMovie, 0, 0,240,426); float newSpeed = map(valueFromArduino, 0, width, 0.1, 5); myMovie.speed(newSpeed); }
Arduino
void setup() {
Serial.begin(9600);
}
void loop() {
int sensorValue = analogRead(A0) / 4;
Serial.write(sensorValue);
// too fast communication might cause some latency in Processing
// this delay resolves the issue.
delay(10);
}
video:
After reading the text Computer Vision for Artist and Designers
I understand that the computer vision technology was once constrained in military and law enforcement purposes. But it can also be used by interactive media artists to build vision-based detection projects to benefit the society. I was amazed by the project Suicide Box by the Bureau of Inverse Technology (Natalie Jeremijenko and Kate Rich) mentioned in the reading. It is a motiondetection video system and track the vertical motion of the jumpers to record the data. It let me think about the moral problems and questions we created when we make a project and after we have created the project, what is the relation between the maker and the project as well as the people interact with it. The project should be meaningful which contains the thoughts of the artists or better to reveal or solve some real problems. I hope I can use processing and Arduino to make a meaningful final project.