This is the week Physical Computing and ICM merged and blew my mind. The joint lab involves graphing a sensor with serial output. After I finished that, I decided to hook up the camera I used for my Stupid Pet Trick, already wired to a photocell in front of the shutter. My processing sketch takes the reading from the photocell to the diameter of a circle. When the shutter opens, a circle is drawn and then the size of that circle is controlled by the aperture setting on the camera.
Shutter Cirlce from Calli Higgins on Vimeo.
Serial Output from Calli Higgins on Vimeo.
The processing code:
import processing.serial.*;
Serial myPort; // The serial port
void setup () {
size(400, 300);
myPort = new Serial(this, Serial.list()[0], 9600);
}
void draw () {
}
void serialEvent (Serial myPort) {
background(131,175,50);
// get the byte:
int inByte = myPort.read();
fill(0);
noStroke();
ellipse(200,150, inByte, inByte);
}