setting a timer for a specific value

stnick's icon

Hi,
I am trying to measure a value from a sensor here and I want to have a rule that a 1 is immediately passed on while a 0 first has to be there for a specific set time.

For example, when an optical sensor senses someone in front of it it should immediately activate an event. However, when it does not sense anyone it should wait a specific amount of time before switching the event off.

The problem that I have is that I am looking for faces with a camera. However the software is not very sensitive and sometimes loses a face. I would like to have some kind of filter so that it makes sure that it doesn't detect a face anymore.

2338.Detest.maxpat
Max Patch
Nate's icon

You might want to check out the external object "lbyl" which is look-before-you-leap. This object is great for filtering out false positives and sensor jitter.

Nate

MIB's icon
Max Patch
Copy patch and select New From Clipboard in Max.

or if you want it time based, rather than input based, try something like the patch below:

Chris Muir's icon
Max Patch
Copy patch and select New From Clipboard in Max.