BASIC4MCU | 질문게시판 | 프로세싱 동영상 재생
페이지 정보
작성자 비공개 작성일2018-06-17 19:52 조회11,339회 댓글0건
https://www.basic4mcu.com/bbs/board.php?bo_table=gac&wr_id=1942
본문
한 번 터치를 하면 영상이 끊길때까지 쭈욱 재생됐으면 하는데 터치를 했을때만 움직이고
전류값이(?) 0 이되면 영상이 바로 멈춰버리네요. 한번 터치 하고 나면 손을 떼고도 계속
영상이 재생되게 하려면 어느 부분을 고쳐야할까요?
아두이노 :
const int sensorPin = A2 ;
int sensorValue = 0 ;
void setup( ) {
Serial.begin(9600);
}
void loop( ) {
sensorValue = analogRead(sensorPin);
Serial.println(sensorValue);
delay(100);
}
프로세싱 :import processing.video.*;import processing.serial.*;Serial myPort;int p;Movie sol;void setup() {size(1920, 1080);sol = new Movie(this, "asdfae.mov");myPort = new Serial(this, "COM5", 9600);myPort.bufferUntil(10);}void draw() {if (p>1000) {sol.play();image(sol, 0, 0);}}void movieEvent(Movie m) {m.read();}void serialEvent(Serial myPort){String s = myPort.readString();s = s.trim();p = int(s);myPort.clear();println(s);}
댓글 0
조회수 11,339등록된 댓글이 없습니다.