Triggering Filestream using RS232?

Hey there,

I’m just getting started using vvvv so this might me an easy question for you guys. But I just can’t seem to get it to work.

I’m working with an Arduino and a motion sensor which sends a “1” to vvvv whenever it detects Motion. Everytime it doesn’t detect motion it sends a “0”. So whenever something is moving I want vvvv to play a .wav file all the way from start to finish. And only play again whenever something is moving again.

Right now I managed to get the signal in vvvv and it starts the filestream with audioout, but only for a very short time as Arduino is sending a “0” straight after which stops the audio again.

How can I trigger the filestream to play the audio once as soon as a “1” comes in no matter if there’s a “0” afterwards? And how do I reset the audio so it starts again when something’s moving again? Right now it only plays once if I start it with a toggle and then it’s over.

Thanks for your help, I really appreciate it :)

Don’t send a “0” from arduino. I dare to say that the general logic of your program could treat “0” and “” quite as the same output.

the node should have some pin signaling the end of file or the time reached by player, so it would be a framedelay (see helppatch) with a togedge node, for example, linked back to reset pin.

this can be done with a FlipFlop node. once you get a “1” you set it and when the file is finished playing you reset it. this involves a FrameDelay node:

image

SoundPlayer.v4p (9.1 KB)

also check out the frequently used nodes: FUN | vvvv

Oh thank you guys so much, that was really helpful and it’s working just like it should now :)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.