Hi João
If the first bang is triggered, wait some time and if within this time
frame the second is triggered as well, then you know the direction. It's
actually mostly about timing and to make sure to clear the state after a
certain time, if not both bangs are triggered within the time frame.
With Firmata, you should either get a 1/0 with a digital input or a
range between 0-1 for an analog value.
.hc
On Aug 17, 2010, at 9:51 AM, João de Brito Rocha Reis Vidigal wrote:
As it is coming from the arduino firmata, the only way I know is
that the signal inputs a bang.
So I'll have
what form is this coming into pd in?
If it's a list (such as (door_crossing in) or (door_crossing out))
then you could parse it down with routes
e.g.
[route door_crossing] (removes the first item in the list, if it's
door_crossing)
|
[sel in out] (the first two inlets will be a bang if it's
As it is coming from the arduino firmata, the only way I know is that the
signal inputs a bang.
So I'll have 2 bangs being hit with a delay between them. this delay depends on
the speed of the body crossing the sensors and its size!
calling them bang1 and bang2, if the order is bang1 then bang2