Forums > Jitter

Serial communication and jitter video

December 17, 2012 | 7:39 pm

Hi,
I’m a newbie and I’m trying to make a video start and play as long as I receive input from a touch sensor.
As long as someone touches the sensor, the video plays. As soon as the sensor remains untouched the video goes black.
My sensor is wired to an arduino board and sends messages via serial communication. It sends 0 if the sensor is not touched, and 1 as long as the sensor is touched.

Normally I would use a conditional statement but I don’t understand how this works in jitter.
I used a select object but my serial port continuously listens to messages so it keeps banging my read message. I want to bang only when the value changes from 0 to 1 and then bang again only when the value changes back to 0.

Any help is appreciated.

– Pasted Max Patch, click to expand. –

December 17, 2012 | 8:16 pm

check out the "change" or "togedge" objects


December 17, 2012 | 8:52 pm

Nice!
Change did the job!

Thank you!


Viewing 3 posts - 1 through 3 (of 3 total)