<?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[[ANSWERED] Sending data from Arduino to Isadora]]></title><description><![CDATA[<p>Hi everyone just a quick one but I'm<a></a><a></a> really struggling to get the distance information from an ultrasonic sensor and Arduino into Isadora, the code to make the sensor work has been clashing with the fermatter code so the Arduino add on for Isadora has not worked for me, the data is showing amazingly in the Arduino software itself with the serial port so i tried the serial watcher in Isadora however it hasn't even recognized inputs after adding the Arduino in the communications tab. any ways round this or advice would be amazing, thank you.</p>]]></description><link>https://community.troikatronix.com/topic/9077/answered-sending-data-from-arduino-to-isadora</link><generator>RSS for Node</generator><lastBuildDate>Mon, 15 Jun 2026 23:58:13 GMT</lastBuildDate><atom:link href="https://community.troikatronix.com/topic/9077.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 27 Nov 2024 16:09:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [ANSWERED] Sending data from Arduino to Isadora on Wed, 04 Dec 2024 20:52:27 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/8442">@ravenetta</a></p><p>Using this ascii chart: <a href="https://upload.wikimedia.org/wikipedia/commons/d/dd/ASCII-Table.svg">upload.wikimedia.org/wikipedia/commons/d/dd/ASCII-Table.svg</a></p><p>I can see that when you receive a Distance, you are getting the value followed by cm and a carrage return and a line feed. so "\r\n"</p><p>You get the same EOL for your errors, so you should be able to use the Serial In Watcher - Text actor with a EOL of 13. You can use this same msg:string={00-FF} to allow all character thru.</p><p></p>]]></description><link>https://community.troikatronix.com/post/55465</link><guid isPermaLink="true">https://community.troikatronix.com/post/55465</guid><dc:creator><![CDATA[DusX]]></dc:creator><pubDate>Wed, 04 Dec 2024 20:52:27 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] Sending data from Arduino to Isadora on Tue, 03 Dec 2024 21:44:44 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/1435">@woland</a> <a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/2066">@Juriaan</a> <a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/124">@DusX</a> here is a video i have of the full set up i am doing in isadora at the moment, i now have the data i am looking or coming in at the end as you can see, however this data does not keep receiving for an extended period as you'll see if you skip to the end of the video, the actor also now shows no indication that it is receiving input? i have used "msg:string={00-FF}" within the actor itself and from using the code suggested above the speed is now 57600 instead of 9600</p>
<p><img src="/assets/uploads/files/1733261980976-no-notification-on-binary.png" style="cursor:pointer" /><br /></p>
<p><img src="/assets/uploads/files/1733261980974-after-pings.png" style="cursor:pointer" /><br /></p>
<p><img src="/assets/uploads/files/1733261981001-futher-errors.png" style="cursor:pointer" /><br /></p>
<iframe src="//www.youtube.com/embed/p-uwlOd_yeE" style="width:500px;height:281px"></iframe> ]]></description><link>https://community.troikatronix.com/post/55459</link><guid isPermaLink="true">https://community.troikatronix.com/post/55459</guid><dc:creator><![CDATA[Ravenetta]]></dc:creator><pubDate>Tue, 03 Dec 2024 21:44:44 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] Sending data from Arduino to Isadora on Tue, 03 Dec 2024 13:17:16 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/8442">@ravenetta</a> <a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/6687">@skuven</a> </p><p>Here's what you had:*</p><p>*I think it is anyway. I cannot tell if you had <br />"Serial.print<strong>I</strong>n" with an upper-case "i" (incorrect)<br />or<br />"Serial.print<strong>l</strong>n" with a lower-case "L" (correct)</p><pre>
#include &lt;SoftwareSerial.h&gt;
SoftwareSerial mySerial(11,10); // RX, TX
unsigned char data[4]={};
float distance;
void setup()
{
    Serial.begin(57600);
    mySerial.begin(9600);
}
void loop()
{
    do{
    for(int i=0;i&lt;4;i++)
    {
    data[i]=mySerial.read();
    }
    }while(mySerial.read()==0xff);
    mySerial.flush();
    if(data[0]==0xff)
    {
    int sum;
    sum=(data[0]+data[1]+data[2])&amp;0x00FF;
    if(sum == data[3])
    {
    distance=(data[1]&lt;&lt;8)+data[2];
    if(distance&gt;30)
    {
    Serial.print("distance=");
    Serial.print(distance/10);
    Serial.println("cm");
    }else
    {
    Serial.println("Below the lower limit");
    }
    }else Serial.println("ERROR");
    }
    delay(100);
}</pre><hr />
<p>I'm unable to trouble-shoot your code myself, but I've had success troubleshooting JavaScript Code with ChatGPT, so here's what it said about your code:</p><p>Issues Identified:<br /></p><ol><li><strong>Incorrect Use of</strong> <em>mySerial.read()</em><strong> in the </strong><em>do...while</em> <strong>Condition:</strong><ol><li>The <em>do...while</em> loop reads an extra byte with <em>mySerial.read() </em>in the condition. This might lead to unexpected behavior as it consumes a byte that is not being processed.</li></ol></li><li><em>mySerial.flush()</em> <strong>Usage:</strong><ol><li><em>mySerial.flush()</em> in <em>SoftwareSerial</em> does <strong>not</strong> flush the input buffer; instead, it waits for outgoing data to finish transmitting. Using it here is unnecessary.</li></ol></li><li><strong>Handling</strong> <em>mySerial.read() </em><strong>Return Values:</strong><ol><li><em>mySerial.read()</em> can return <em>-1</em> if no data is available. This needs to be checked before assigning the read value to <em>data[i]</em>.</li></ol></li><li><strong>Hardcoded Limit Check:</strong><ol><li>The condition <em>distance &gt; 30 </em>is hardcoded. If this is a threshold specific to the application, it would be better to define it as a constant for clarity.</li></ol></li><li><strong>Lack of Non-blocking Delay:</strong><br /><ol><li>The <em>delay(100)</em> call blocks further execution, which can be problematic if the loop needs to process data continuously or in real-time.</li></ol></li></ol><pre>
#include &lt;SoftwareSerial.h&gt;
SoftwareSerial mySerial(11, 10); // RX, TX
unsigned char data[4] = {};
float distance;
const int LOWER_LIMIT = 30; // Define threshold as a constant
void setup()
{
    Serial.begin(57600);
    mySerial.begin(9600);
}
void loop()
{
    // Ensure enough data is available before proceeding
    if (mySerial.available() &gt;= 4)
    {
        // Read 4 bytes into the data array
        for (int i = 0; i &lt; 4; i++)
        {
            int byteReceived = mySerial.read();
            if (byteReceived == -1) return; // Exit if no valid data is read
            data[i] = byteReceived;
        }
        // Check the first byte for the expected header
        if (data[0] == 0xFF)
        {
            // Calculate checksum
            int sum = (data[0] + data[1] + data[2]) &amp; 0x00FF;
            if (sum == data[3]) // Validate checksum
            {
                // Calculate distance
                distance = (data[1] &lt;&lt; 8) + data[2];
                if (distance &gt; LOWER_LIMIT)
                {
                    Serial.print("Distance = ");
                    Serial.print(distance / 10.0); // Divide by 10 for decimal result
                    Serial.println(" cm");
                }
                else
                {
                    Serial.println("Below the lower limit");
                }
            }
            else
            {
                Serial.println("ERROR: Checksum mismatch");
            }
        }
    }
    delay(100); // Optional: Use millis() for non-blocking delays if needed
}</pre><p>(Personally I'm not sure about the "&lt;/SoftwareSerial.h&gt;" in the last line, so if this code doesn't run, try it with the last line as just "}".)</p><hr />
<p>Claude said similar, but not identical things:</p><ol><li>Error Handling in Serial Reading:<ol><li><code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.3rem] px-1 py-px text-[0.9rem]">mySerial.read()</code> returns -1 if no data is available, which might cause unexpected behavior</li><li>The current <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.3rem] px-1 py-px text-[0.9rem]">do-while</code> loop may get stuck if no valid data is received</li></ol></li><li>Checksum Calculation:<ol><li>The checksum calculation looks correct, but ensure the sensor protocol matches exactly</li><li>The <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.3rem] px-1 py-px text-[0.9rem]">&amp;0x00FF</code> might be unnecessary if you're using standard 8-bit arithmetic</li></ol></li></ol><p>Key changes:</p><ul><li>Check <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.3rem] px-1 py-px text-[0.9rem]">mySerial.available()</code> before reading</li>
<li>Use bitwise OR <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.3rem] px-1 py-px text-[0.9rem]">|</code> instead of addition for distance calculation</li>
<li>Added decimal to distance division for float precision</li>
<li>Simplified error handling</li>
</ul>
<p>Potential debugging steps:</p>
<ol><li>Verify sensor protocol matches this exact format</li>
<li>Check physical connections</li>
<li>Use Serial Monitor to verify data reception</li></ol>
<pre>
#include &lt;SoftwareSerial.h&gt;
SoftwareSerial mySerial(11, 10); // RX, TX
unsigned char data[4] = {};
float distance;
void setup() {
    Serial.begin(57600);
    mySerial.begin(9600);
}
void loop() {
    if (mySerial.available() &gt;= 4) {
        for (int i = 0; i &lt; 4; i++) {
            data[i] = mySerial.read();
        }
        if (data[0] == 0xFF) {
            int sum = (data[0] + data[1] + data[2]) &amp; 0xFF;
            if (sum == data[3]) {
                distance = (data[1] &lt;&lt; 8) | data[2];
                if (distance &gt; 30) {
                    Serial.print("Distance = ");
                    Serial.print(distance / 10.0);
                    Serial.println(" cm");
                } else {
                    Serial.println("Below lower limit");
                }
            } else {
                Serial.println("Checksum error");
            }
        }
    }
    delay(100);
}</pre>]]></description><link>https://community.troikatronix.com/post/55450</link><guid isPermaLink="true">https://community.troikatronix.com/post/55450</guid><dc:creator><![CDATA[Woland]]></dc:creator><pubDate>Tue, 03 Dec 2024 13:17:16 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] Sending data from Arduino to Isadora on Mon, 02 Dec 2024 18:54:39 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/8442">@ravenetta</a></p>
<p>Since it appears your EOL is causing the buffer to fill, you could try not using Serial.println() to automatically add a EOL (end of each text  segment), and instead use Serial.print("\r") to add an EOL that you have control of. Often "\r\n" are used, these correspond to the ASCII values <code>13</code> (CR) and <code>10</code> (LF), in this case we only need to add/find "\r" or value <code>13</code><br /><br />EOL = 13, sets the actor to look for a carriage return (13). <br />You can learn a bit about using these here: <a href="https://stackoverflow.com/questions/1761051/difference-between-n-and-r">newline - Difference between \n and \r? - Stack Overflow</a></p>
<p>Once you are adding your own EOL, you can makes changes and test in Isadora until you get the output you are expecting.</p>]]></description><link>https://community.troikatronix.com/post/55443</link><guid isPermaLink="true">https://community.troikatronix.com/post/55443</guid><dc:creator><![CDATA[DusX]]></dc:creator><pubDate>Mon, 02 Dec 2024 18:54:39 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] Sending data from Arduino to Isadora on Sun, 01 Dec 2024 00:55:08 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/8442">@ravenetta</a></p><p>Might be most helpful to copy and paste the code than an image we can't copy the code from..? maybe upload a text file with it if thats possible?</p>]]></description><link>https://community.troikatronix.com/post/55438</link><guid isPermaLink="true">https://community.troikatronix.com/post/55438</guid><dc:creator><![CDATA[skuven]]></dc:creator><pubDate>Sun, 01 Dec 2024 00:55:08 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] Sending data from Arduino to Isadora on Sat, 30 Nov 2024 10:19:59 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/2066">@juriaan</a> this is the current code I have in the arduino the error message above was when using the serial in watcher - Text </p><p>The videos if data being 'recived' was with using the serial in watcher - binary </p><p>No code changes with arduino </p>
<p><img src="/assets/uploads/files/1732961260464-screenshot_20241130_100516_teams.jpg" style="cursor:pointer" /><img src="/assets/uploads/files/1732961260489-screenshot_20241130_100529_teams.jpg" style="cursor:pointer" /></p>]]></description><link>https://community.troikatronix.com/post/55436</link><guid isPermaLink="true">https://community.troikatronix.com/post/55436</guid><dc:creator><![CDATA[Ravenetta]]></dc:creator><pubDate>Sat, 30 Nov 2024 10:19:59 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] Sending data from Arduino to Isadora on Sat, 30 Nov 2024 09:43:43 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/8442">@ravenetta</a></p><p>Well, according to the error message your EOM character is not 13. Could you share the Arduino code with us?</p>]]></description><link>https://community.troikatronix.com/post/55435</link><guid isPermaLink="true">https://community.troikatronix.com/post/55435</guid><dc:creator><![CDATA[Juriaan]]></dc:creator><pubDate>Sat, 30 Nov 2024 09:43:43 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] Sending data from Arduino to Isadora on Sat, 30 Nov 2024 00:28:06 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/124">@dusx</a> </p><p>hi thanks for the suggestion, I'm not sure how this actor works as the error message above is when I tried the text actor, I wasn't receiving any indication that data was being received by this actor other than the error above popping up every minute or so? The message received part of the actor wasn't even triggering unlike the digital actor witch seemed to trigger this section.</p><p></p>]]></description><link>https://community.troikatronix.com/post/55433</link><guid isPermaLink="true">https://community.troikatronix.com/post/55433</guid><dc:creator><![CDATA[Ravenetta]]></dc:creator><pubDate>Sat, 30 Nov 2024 00:28:06 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] Sending data from Arduino to Isadora on Fri, 29 Nov 2024 18:58:32 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/8442">@ravenetta</a><br /></p><p>Looking at your messages, I think you should try the 'Serial In Watcher - Text' actor.</p><p></p>]]></description><link>https://community.troikatronix.com/post/55432</link><guid isPermaLink="true">https://community.troikatronix.com/post/55432</guid><dc:creator><![CDATA[DusX]]></dc:creator><pubDate>Fri, 29 Nov 2024 18:58:32 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] Sending data from Arduino to Isadora on Fri, 29 Nov 2024 17:18:16 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/2066">@juriaan</a> this is the message i receive if i use the serial watcher- text actor this happens after about a minute, the actor itself does not show any signs of receiving data, once i have this data accurately coming into Isadora the plan is to have this data be able to be readable within the soft wear so i can send these values to edit brightness of content based on the distance of a person. </p><img src="/assets/uploads/files/1732900542245-serial-watcher-sensor-error.png" />]]></description><link>https://community.troikatronix.com/post/55431</link><guid isPermaLink="true">https://community.troikatronix.com/post/55431</guid><dc:creator><![CDATA[Ravenetta]]></dc:creator><pubDate>Fri, 29 Nov 2024 17:18:16 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] Sending data from Arduino to Isadora on Fri, 29 Nov 2024 16:29:01 GMT]]></title><description><![CDATA[<iframe src="//www.youtube.com/embed/PE_hPOMb3As" style="width:500px;height:281px"></iframe> <p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/2066">@juriaan</a> here are some screen recordings from both Arduino and the results i am getting in Isadora- this is using the binary watcher</p>
<iframe style="width:500px;height:281px" src="//www.youtube.com/embed/f0t2K0fPFW8"></iframe>
<iframe style="width:500px;height:281px" src="//www.youtube.com/embed/uC3W1RhYFVY"></iframe>]]></description><link>https://community.troikatronix.com/post/55430</link><guid isPermaLink="true">https://community.troikatronix.com/post/55430</guid><dc:creator><![CDATA[Ravenetta]]></dc:creator><pubDate>Fri, 29 Nov 2024 16:29:01 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] Sending data from Arduino to Isadora on Fri, 29 Nov 2024 14:08:57 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/8442">@ravenetta</a></p>
<p>The question after that Is the following:</p>
<p>- What is the format of your message; since the Isadora actors can only 'sent' a message to the actor out, if it has been specified what the format is. <br /></p>
<p></p>
<p>If you double click a 'Serial In Watcher - Text'' or a  'Serial In Watcher - Binary' you will an empty text window. According to the help dialog (press the help button) you will see exactly what format is being required for all the different types of data that Isadora supports. It is up to you now to define the amount of bytes, characters or numbers that you expect, and how that is message is being 'terminated'</p>
<p>Feel free to showcase us how the data comes in in the Arduino IDE, and happy to help you out :)</p><p></p>]]></description><link>https://community.troikatronix.com/post/55428</link><guid isPermaLink="true">https://community.troikatronix.com/post/55428</guid><dc:creator><![CDATA[Juriaan]]></dc:creator><pubDate>Fri, 29 Nov 2024 14:08:57 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] Sending data from Arduino to Isadora on Fri, 29 Nov 2024 14:03:52 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/8442">@ravenetta</a></p>
<p>Hi there, a couple different things here really:</p>
<p>1) When a port is 'Busy' be opening the Serial monitor (From the Arduino IDE) it causes Isadora not to be able to see it, please close this and 'restart' the Arduino to your computer</p>
<p>2) Make sure that you setup your Serial ports in the Serial Port Setup window. The important thing is the 'Port' (Device in Isadora window) and the 'Baud rate' (Speed in the Isadora window). Speed has to match the speed that you wrote down in your setup function within the Arduino IDE</p>
<p>3) Now that we got everything setup we need to start our serial devices, you can simply do that by going to Enable Serial Ports, underneath the Communications menu.</p>
<p>After that you should be able to see messages from your Serial device in the Windows &gt; Show Monitor tab</p>
<p></p>
<p></p>]]></description><link>https://community.troikatronix.com/post/55427</link><guid isPermaLink="true">https://community.troikatronix.com/post/55427</guid><dc:creator><![CDATA[Juriaan]]></dc:creator><pubDate>Fri, 29 Nov 2024 14:03:52 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] Sending data from Arduino to Isadora on Fri, 29 Nov 2024 13:17:01 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/124">@dusx</a> wonder if you might be able to help? We have data coming into Isadora via the serial monitor but we can't figure out the serial actors and how to view the numbers. </p>]]></description><link>https://community.troikatronix.com/post/55426</link><guid isPermaLink="true">https://community.troikatronix.com/post/55426</guid><dc:creator><![CDATA[Skulpture]]></dc:creator><pubDate>Fri, 29 Nov 2024 13:17:01 GMT</pubDate></item></channel></rss>