We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › save a digital state that changes often
Page Index Toggle Pages: 1
save a digital state that changes often (Read 367 times)
save a digital state that changes often
May 28th, 2009, 6:32am
 
hi there,

unfortunately i didn't find an answer to my question yet. maybe you could help..

i have a motion detection sensor with a digital out that states "1" for "no movement" and "0" for "there's movement".

when there's movement the sensor outputs "0" 2 short times, then goes back to "1".

i wish to show a video if there's movement, so i need to measure the 0-trigger - for that i have to record the state as long as the duration of the video.

that's my problem. dunno how to do that.

hope you can guide me on path, i'm stuck in the forest.
thanks in advance,
chris
Re: save a digital state that changes often
Reply #1 - May 28th, 2009, 9:00am
 
I'm not sure I follow.  Why do you need to record the state as long as the duration of the video?  Presumably to stop a new trigger event starting it from the beginning?  If so then you'd do better to track the current state of the video (i.e. playing/not playing) and test against that when a trigger event occurs...  If it's already playing do nothing, otherwise play it.
Re: save a digital state that changes often
Reply #2 - May 28th, 2009, 9:04am
 
Just saw this  

Any reason you needed to post this question twice

Huh
Page Index Toggle Pages: 1