Reflection after Reading
In this recitation, I used a photoresistor on Arduino to control the play and pause of my media which is displayed through Processing. The initial of me trying this interaction is mainly to get myself more familiar with the usage of photoresistor as well as some basic interaction function about media in Processing.
After reading the article, Computer Vision for Artists and Designers: Pedagogic Tools and Techniques for Novice Programmers, I have reflected on myself about my created interaction. In the article, it listed out several vivid examples of how computer vision interaction can be. Interacting with or creating one’s own video through body movements, detect people’s motion with the use of computer vision technique, and even embed or used to develop robots. Compared with those examples, my interaction that was done in the recitation seems far too simple. It seems like I have only done a simple test about how to use physical elements to control some basic properties of a simple short and already existing and chosen video. Therefore, if I have the chance, I want to learn more about how to make the users have a higher interaction level with the computer. For example, what I am going to do in my final project, trying to figure out how to let users draw a painting on the screen with body movement.
Video Documentation:
Code:
Arduino:
// LAB8 - 讀取光敏電阻 (v1) int photocellPin = 2; // 光敏電阻 (photocell) 接在 anallog pin 2 int photocellVal = 0; // photocell variable void setup() { Serial.begin(9600); } void loop() { // 讀取光敏電阻並輸出到 Serial Port photocellVal = analogRead(photocellPin); Serial.println(photocellVal); int sensorValue = analogRead(A2); Serial.write(sensorValue); delay(100); }
Processing:
import processing.serial.*; Serial myPort; int sensorValue; import processing.video.*; Movie myMovie; void setup() { size(300,500); background(0); myMovie = new Movie(this, "myMovie1.mp4"); myMovie.play(); printArray(Serial.list()); // this prints out the list of all available serial ports on your computer. myPort = new Serial(this, Serial.list()[13], 9600); } void draw() { //background(0); // to read the value from the Arduino while ( myPort.available() > 0) { sensorValue = myPort.read(); } println(sensorValue);//This prints out the values from Arduino if (myMovie.available()) { myMovie.read(); //image(myMovie, 0, 0, width, height); } //image(myMovie, 0, 0, width, height); //if (sensorValue > 5 && sensorValue < 50){ // myMovie.pause(); //} image(myMovie, 0, 0, width, height); if (sensorValue > 5 && sensorValue < 50){ myMovie.pause(); } else{ myMovie.play(); } }