great!
giuliomoro In your small screenshot here, the message [; set-a bang( will be sent every time the toggle is toggled, regardless of the output of the [&&], maybe you were thinking of adding a [select 1] in between the two?
Clarification: [&&]
sends out an output every time a float or a bang are received from the left inlet. The output will be "0" if at least one of the inlets was last set to 0, and "1" if they were both last set to 1. In your example here:
!https://i.imgur.com/rnn7Mgj.png
the [&&]
sends an output every time the toggle is toggled (as it goes into the left inlet), and every time a value is received from [r bela_digitalIn19]
(because of the [t b f]
), and it will only output 1
if the toggle is on and the [r bela_digitalIn19]
received a 1
. It will send out a 0
otherwise. However, the output value of [&&]
is actually ignored, because, its outlet is connected to a message ( [; set-a bang;(
), which makes no use of its inlet (e.g.: using $1
in the body of the message), and therefore it will send bang
to set-a
every time [&&]
sends one output (that is, as mentioned, every time any message is received from bela_digitalIn19
or from the toggle, and regardless of the state of bela_digitalIn19
or of the toggle).
Functionally that is equivalent to:
[X] << toggle
|
| [r bela_digitalIn19]
| /
|/
[bang]
|
[; set-a bang;(
or, equivalently,
[X] << toggle
|
| [r bela_digitalIn19]
| /
|/
[; set-a bang;(