Hi there
Am at the moment trying to understand how to *play a video* only when force from arduino.analogRead(0) receives input and the
if else statement stops (or should) video when nothing happening.
At the moment the input stops at original position of potentiometer, otherwise event continues.
I'm unsure as to what's going wrong: have tried using different boolean operators & am considering using a for loop, could this be worth while?
thanks
Calum
Code:
void draw() {
println(arduino.analogRead(0));
if(arduino.analogRead(0) != curInput){
i++;
fill(0,0,0,i); //i is used for transperancy
rect(0,0,width,height);
if (i > 60) {
i = 0;
}
image(theMov, 0, 0);
//println("RING BELL");
}
// else if (curInput == arduino.analogRead(0)) {
else if(arduino.analogRead(0) == arduino.analogRead(0)) {
i++;
fill(255,255,255,i); //i is used for transperancy
rect(0,0,width,height);
if (i > 60) {
i = 0;
}
theMov.stop();
theMov.loop();
}
}