Serial communication and jitter video

Dec 17, 2012 at 7:39pm

Serial communication and jitter video

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. –
#65721
Dec 17, 2012 at 8:16pm

check out the “change” or “togedge” objects

#236776
Dec 17, 2012 at 8:52pm

Nice!
Change did the job!

Thank you!

#236777

You must be logged in to reply to this topic.