[PD] List delete carnage - 2 questions

Charles Goyard cg at fsck.fr
Sun Mar 27 03:07:29 CEST 2011


J bz wrote:
> 
> I have a sensor which is spitting out numbers between 1-180.
> 
> Each number triggers an event that I only want to happen once but the sensor
> repeats numbers every so often.

You can use a table of 180 elements, each of which is initialized with
zeros. When a sensor number occurs, check against the table. If it's 0,
turn it to 1 and go on. If it's 1, do nothing and wait for a fresh
number from the sensor. Or, if you don't want to wait, scan the
table for the first zero. What appends when there's no zeros left is up
to you.

> (patch attached)

You did not sew it solid enough it seems:).

-- 
Charlot



More information about the Pd-list mailing list