Ok so, here’s what my draw() looks like
void draw() {
if(arduino.available()>0)
{
serialIn=arduino.read();
println(serialIn);
if (val <= THRESHOLD) { //If the sensor detect object at less 50cm
sound.stop();
video.play();
//image(video,0,0);
useImageMovie= true;
}
if(useImageMovie) {
image(video,0,0);
useImageMovie = false;
}
else {
image(sound,0,0);
}
useImageMovie= false;
}
}
but still nothing. The first video stops and the second plays right after without any interaction with the sensor.
I’m sorry I dont understand the question.