<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[trigger object not working as expected]]></title><description><![CDATA[<p>The left part of patch is working as expected while the right hand part is not. why the object trigger is not turning the toggle on and off?</p>
<p><img src="/uploads/files/1675959154247-trigger.png" alt="trigger.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14262/trigger-object-not-working-as-expected</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 16:01:28 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/14262.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 09 Feb 2023 16:13:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to trigger object not working as expected on Thu, 09 Feb 2023 16:13:21 GMT]]></title><description><![CDATA[<p>The left part of patch is working as expected while the right hand part is not. why the object trigger is not turning the toggle on and off?</p>
<p><img src="/uploads/files/1675959154247-trigger.png" alt="trigger.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14262/trigger-object-not-working-as-expected</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14262/trigger-object-not-working-as-expected</guid><dc:creator><![CDATA[KMETE]]></dc:creator><pubDate>Thu, 09 Feb 2023 16:13:21 GMT</pubDate></item><item><title><![CDATA[Reply to trigger object not working as expected on Thu, 09 Feb 2023 16:20:18 GMT]]></title><description><![CDATA[<p>and the second part of the question:</p>
<p>I try to send the message A 0 or A 1 to the arduino via serial object but I'm getting an error. What am I missing?</p>
<p><img src="/uploads/files/1675959573407-trigger2.png" alt="trigger2.png" class="img-responsive img-markdown" /></p>
<p>and my arduino code:</p>
<pre><code>const int LED_pins[] = {11, 12, 13};
const int NUM_LEDS = 3;

void setup() {
  for (int i = 0; i &lt; NUM_LEDS; i++) {
    pinMode(LED_pins[i], OUTPUT);
  }
  Serial.begin(115200);
}

void loop() {
  if (Serial.available() &gt; 0) {
    char id = Serial.read();
    int state = Serial.parseInt();
    if (id == 'A') {
      digitalWrite(LED_pins[0], state);
    } else if (id == 'B') {
      digitalWrite(LED_pins[1], state);
    } else if (id == 'C') {
      digitalWrite(LED_pins[2], state);
    }
  }
}
</code></pre>
]]></description><link>http://forum.pdpatchrepo.info/topic/14262/trigger-object-not-working-as-expected/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14262/trigger-object-not-working-as-expected/2</guid><dc:creator><![CDATA[KMETE]]></dc:creator><pubDate>Thu, 09 Feb 2023 16:20:18 GMT</pubDate></item><item><title><![CDATA[Reply to trigger object not working as expected on Thu, 09 Feb 2023 16:57:09 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/kmete">@KMETE</a> For the  [toggle] I am pretty sure [t b 1] will send a 0 instead of a 1.  In fact any float value will send 0.<br />
The correct parameters for [toggle] are f b s l p a (float, bang, symbol, list, pointer, anything).</p>
<p>[[list fromsymbol] expects a symbol obviously, but what is not obvious is that symbols need to be tagged explicitly as a symbol or they are simply &quot;text&quot;...... it drives us nuts sometimes.<br />
So you need the message [symbol A $1(<br />
But that will not work...... as it will only receive the A because of the space afterward...... so you will have to stick the $1 to the A....... [symbol A$1( will produce 65 48 (for 0) and 65 49 (for 1).<br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14262/trigger-object-not-working-as-expected/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14262/trigger-object-not-working-as-expected/3</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Thu, 09 Feb 2023 16:57:09 GMT</pubDate></item><item><title><![CDATA[Reply to trigger object not working as expected on Thu, 09 Feb 2023 18:43:32 GMT]]></title><description><![CDATA[<p>This is what I'm getting when do the following: (not quite what I am expecting)</p>
<p><img src="/uploads/files/1675968149956-screen-shot-2023-02-09-at-20.41.48.png" alt="Screen Shot 2023-02-09 at 20.41.48.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14262/trigger-object-not-working-as-expected/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14262/trigger-object-not-working-as-expected/4</guid><dc:creator><![CDATA[KMETE]]></dc:creator><pubDate>Thu, 09 Feb 2023 18:43:32 GMT</pubDate></item><item><title><![CDATA[Reply to trigger object not working as expected on Thu, 09 Feb 2023 18:45:52 GMT]]></title><description><![CDATA[<p>and that is what I'm getting when added [list fromsymbol] (as well not quite what I would expect it)</p>
<p><img src="/uploads/files/1675968351913-screen-shot-2023-02-09-at-20.45.14.png" alt="Screen Shot 2023-02-09 at 20.45.14.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14262/trigger-object-not-working-as-expected/5</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14262/trigger-object-not-working-as-expected/5</guid><dc:creator><![CDATA[KMETE]]></dc:creator><pubDate>Thu, 09 Feb 2023 18:45:52 GMT</pubDate></item><item><title><![CDATA[Reply to trigger object not working as expected on Thu, 09 Feb 2023 18:50:05 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/kmete">@KMETE</a> It needs to be a message...... [symbol A$1(...... not an object [symbol A$1]<br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14262/trigger-object-not-working-as-expected/6</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14262/trigger-object-not-working-as-expected/6</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Thu, 09 Feb 2023 18:50:05 GMT</pubDate></item><item><title><![CDATA[Reply to trigger object not working as expected on Thu, 09 Feb 2023 19:05:10 GMT]]></title><description><![CDATA[<p>Thanks working like a charm! for some reason the output in arduino was flipped so I just change this:</p>
<pre><code>if (id == 'A') {
      digitalWrite(LED_pins[0], state);}
</code></pre>
<p>to this:</p>
<pre><code>if (id == 'A') {
      digitalWrite(LED_pins[0], !state);
</code></pre>
]]></description><link>http://forum.pdpatchrepo.info/topic/14262/trigger-object-not-working-as-expected/7</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14262/trigger-object-not-working-as-expected/7</guid><dc:creator><![CDATA[KMETE]]></dc:creator><pubDate>Thu, 09 Feb 2023 19:05:10 GMT</pubDate></item><item><title><![CDATA[Reply to trigger object not working as expected on Thu, 09 Feb 2023 19:46:28 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/kmete">@KMETE</a> I don't &quot;know&quot; but it could be that the leds are turned on by &quot;pull down&quot;.<br />
For that the leds are connected between the +Ve rail and the pin and turn on when the Pin goes to 0V.<br />
When the pin is high (+ve) the led is off.<br />
That might explain the reversal.<br />
Maybe?<br />
The pin can be at 0V or 3.3V (logic volts).  Using pull down you can get 5V (between 0V and the 5V power rail).  Useful for relays (if there are no opto-isolators on the relay board), but for a led you only need 0.7V and a current limiting resistor so not necessary..... but.... I don't know how they are wired for the Arduino.<br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14262/trigger-object-not-working-as-expected/8</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14262/trigger-object-not-working-as-expected/8</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Thu, 09 Feb 2023 19:46:28 GMT</pubDate></item><item><title><![CDATA[Reply to trigger object not working as expected on Thu, 09 Feb 2023 19:46:37 GMT]]></title><description><![CDATA[<p>how can I send data back from arduino to pd while transfering data from pd to arduino?</p>
<p>so when I'm sending A 1 to arduino I'm turning led ON and I would like to receive in pd the message &quot;Led1 On&quot; in pd</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14262/trigger-object-not-working-as-expected/9</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14262/trigger-object-not-working-as-expected/9</guid><dc:creator><![CDATA[KMETE]]></dc:creator><pubDate>Thu, 09 Feb 2023 19:46:37 GMT</pubDate></item><item><title><![CDATA[Reply to trigger object not working as expected on Thu, 09 Feb 2023 20:35:40 GMT]]></title><description><![CDATA[<p>solved it:</p>
<pre><code>const int LED_pin[] = {13, 12, 11};
const int NUM_LEDS = 1;
const char LED_ids[] = {'A', 'B', 'C'};

void setup() {
  for (int i = 0; i &lt; NUM_LEDS; i++) {
    pinMode(LED_pin[i], OUTPUT);
  }
  Serial.begin(115200);
}

void loop() {
  if (Serial.available() &gt; 0) {
    char id = Serial.read();
    int state = Serial.parseInt();
    for (int i = 0; i &lt; NUM_LEDS; i++) {
      if (id == LED_ids[i]) {
        digitalWrite(LED_pin[i], !state);
        Serial.print(&quot;led&quot;);
        Serial.println(i + 1);
        Serial.print(&quot;&quot;);
        Serial.println(!state);
        break;
      }
    }
  }
}

</code></pre>
<p><img src="/uploads/files/1675974938198-screen-shot-2023-02-09-at-22.35.11.png" alt="Screen Shot 2023-02-09 at 22.35.11.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14262/trigger-object-not-working-as-expected/10</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14262/trigger-object-not-working-as-expected/10</guid><dc:creator><![CDATA[KMETE]]></dc:creator><pubDate>Thu, 09 Feb 2023 20:35:40 GMT</pubDate></item></channel></rss>