132
edits
No edit summary |
No edit summary |
||
Line 53: | Line 53: | ||
println(Serial.list()); | println(Serial.list()); | ||
myPort = new Serial(this,"/dev/tty.usbmodem411",9600); | myPort = new Serial(this,"/dev/tty.usbmodem411",9600); | ||
} | |||
void draw() { | void draw() { | ||
Line 61: | Line 61: | ||
incomingVal = myPort.read(); | incomingVal = myPort.read(); | ||
println(incomingVal); | println(incomingVal); | ||
} | |||
fill(174,221,60); | fill(174,221,60); | ||
Line 86: | Line 86: | ||
rotate(radians(hourAngle) - radians(90)); | rotate(radians(hourAngle) - radians(90)); | ||
line(0, 0, 50, 0); | line(0, 0, 50, 0); | ||
} | |||
</source> | </source> | ||
<br /><br /> | <br /><br /> | ||
'''Processing 2''' | '''Processing 2''' | ||
<source lang="java"> | |||
// Video jump and play by incomingValue. | |||
import processing.video.*; | |||
Movie myMovie; | |||
import processing.serial.*; | |||
Serial myPort; | |||
int incomingVal; | |||
void setup() { | |||
size(640,480,P2D); | size(640,480,P2D); | ||
Line 107: | Line 109: | ||
println(Serial.list()); | println(Serial.list()); | ||
myPort = new Serial(this,"/dev/tty.usbmodem411",9600); | myPort = new Serial(this,"/dev/tty.usbmodem411",9600); | ||
} | |||
void movieEvent(Movie myMovie) { | |||
myMovie.read(); | myMovie.read(); | ||
} | |||
void draw() { | |||
while(myPort.available() > 0){ | while(myPort.available() > 0){ | ||
incomingVal = myPort.read(); | incomingVal = myPort.read(); | ||
Line 121: | Line 123: | ||
} | } | ||
image(myMovie, 0, 0); | image(myMovie, 0, 0); | ||
} | |||
void mousePressed(){ | void mousePressed(){ | ||
myMovie.jump(incomingVal); | myMovie.jump(incomingVal); | ||
} | |||
</source> | |||
<br /><br /> | |||
[[File:wedding8.jpg|400px|]] | [[File:wedding8.jpg|400px|]] | ||
edits