Re: [PD] Bang order entry

2010-08-20 Thread Roman Haefeli
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.

Check the attached (ugly; done with touchpad) patch.

Roman
 

On Tue, 2010-08-17 at 13:45 +0100, João de Brito Rocha Reis Vidigal
wrote:
 Hi again.
 Here goes another problem!
 
 Ok. So I'm working with Arduino firmata here... 
 To expose to problem in a simple way, I have 2 sensors that are detecting a 
 door crossing.
 The 2 detectors give an order to the door crossing: coming in or going out.
 Now I just don't know how I can translate that to bang 2 different [bang( 
 depending on if someone's comming in or going out!
 
 Can you help me with that!?
 Thanks


#N canvas 424 192 632 528 10;
#X obj 81 -7 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 116 -7 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 77 251 symbol;
#X msg 217 181 symbol left;
#X obj 200 249 symbol;
#X msg 94 178 symbol right;
#X msg 242 120 symbol empty;
#X obj 149 294 select empty;
#X obj 234 362 print;
#X obj 233 321 t a b;
#X msg 347 53 stop;
#X obj 415 86 t b b;
#X obj 243 92 delay 1000;
#X connect 0 0 5 0;
#X connect 0 0 2 0;
#X connect 0 0 12 0;
#X connect 1 0 3 0;
#X connect 1 0 4 0;
#X connect 1 0 12 0;
#X connect 2 0 7 0;
#X connect 3 0 2 1;
#X connect 4 0 7 0;
#X connect 5 0 4 1;
#X connect 6 0 2 1;
#X connect 6 0 4 1;
#X connect 7 1 9 0;
#X connect 9 0 8 0;
#X connect 9 1 11 0;
#X connect 10 0 12 0;
#X connect 11 0 10 0;
#X connect 11 1 6 0;
#X connect 12 0 6 0;
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Bang order entry

2010-08-19 Thread Hans-Christoph Steiner


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 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 =  
coming in, if it is bang2 then bang1 it means coming out.
the thing is I think I have to pair the hits to set an order and I  
just don't know how to pair them and read it to then bang an in or  
an out.





On 17 Aug 2010, at 14:29, Andrew Faraday wrote:

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 in or out  
respectively)


Not sure how else you might be getting the data into pd

 From: jbvidi...@gmail.com
 Date: Tue, 17 Aug 2010 13:45:53 +0100
 To: pd-list@iem.at
 Subject: [PD] Bang order entry

 Hi again.
 Here goes another problem!

 Ok. So I'm working with Arduino firmata here...
 To expose to problem in a simple way, I have 2 sensors that are  
detecting a door crossing.
 The 2 detectors give an order to the door crossing: coming in or  
going out.
 Now I just don't know how I can translate that to bang 2 different  
[bang( depending on if someone's comming in or going out!


 Can you help me with that!?
 Thanks

 Joao Vidigal
 ___
 Pd-list@iem.at mailing list
 UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list






Computer science is no more related to the computer than astronomy is  
related to the telescope.  -Edsger Dykstra



___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


[PD] Bang order entry

2010-08-17 Thread João de Brito Rocha Reis Vidigal
Hi again.
Here goes another problem!

Ok. So I'm working with Arduino firmata here... 
To expose to problem in a simple way, I have 2 sensors that are detecting a 
door crossing.
The 2 detectors give an order to the door crossing: coming in or going out.
Now I just don't know how I can translate that to bang 2 different [bang( 
depending on if someone's comming in or going out!

Can you help me with that!?
Thanks

Joao Vidigal
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Bang order entry

2010-08-17 Thread Andrew Faraday

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 in or out 
respectively)

Not sure how else you might be getting the data into pd

 From: jbvidi...@gmail.com
 Date: Tue, 17 Aug 2010 13:45:53 +0100
 To: pd-list@iem.at
 Subject: [PD] Bang order entry
 
 Hi again.
 Here goes another problem!
 
 Ok. So I'm working with Arduino firmata here... 
 To expose to problem in a simple way, I have 2 sensors that are detecting a 
 door crossing.
 The 2 detectors give an order to the door crossing: coming in or going out.
 Now I just don't know how I can translate that to bang 2 different [bang( 
 depending on if someone's comming in or going out!
 
 Can you help me with that!?
 Thanks
 
 Joao Vidigal
 ___
 Pd-list@iem.at mailing list
 UNSUBSCRIBE and account-management - 
 http://lists.puredata.info/listinfo/pd-list
  ___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Bang order entry

2010-08-17 Thread João de Brito Rocha Reis Vidigal
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 = coming in, if 
it is bang2 then bang1 it means coming out.
the thing is I think I have to pair the hits to set an order and I just don't 
know how to pair them and read it to then bang an in or an out.




On 17 Aug 2010, at 14:29, Andrew Faraday wrote:

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 in or out 
respectively)

Not sure how else you might be getting the data into pd

 From: jbvidi...@gmail.com
 Date: Tue, 17 Aug 2010 13:45:53 +0100
 To: pd-list@iem.at
 Subject: [PD] Bang order entry
 
 Hi again.
 Here goes another problem!
 
 Ok. So I'm working with Arduino firmata here... 
 To expose to problem in a simple way, I have 2 sensors that are detecting a 
 door crossing.
 The 2 detectors give an order to the door crossing: coming in or going out.
 Now I just don't know how I can translate that to bang 2 different [bang( 
 depending on if someone's comming in or going out!
 
 Can you help me with that!?
 Thanks
 
 Joao Vidigal
 ___
 Pd-list@iem.at mailing list
 UNSUBSCRIBE and account-management - 
 http://lists.puredata.info/listinfo/pd-list

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list