user15045: The linux processor runs a Python script from which I would like to send an array of integers to the Yun microprocessor. How can I do that?
And then, how can I retrieve and then use this array in my Arduino Sketch?

user15045: Given that my Python script printed the following
[10, 20, 30, 40]

This is the sketch I used to retrieve the array
#include <Bridge.h>
#include <Process.h>

void setup()
{
   Bridge.begin();
   Serial.begin(19200);
}

void loop()
{
   Process proc;
   int i=0;
   size_t dim = 1;
   int* array = (int*)malloc(dim);


   Serial.print("Running process...");
   Serial.println("done!");
   proc.runShellCommand("python /script.py");

   while (proc.available()){
     if((char)proc.read() != ']'){
        array[i] = proc.parseInt();
        dim++;
        array = (int*)realloc(array,dim);
        Serial.println(array[i]);
        i++;
      }
      else
        break;
   }

   Serial.println();
   delay(1000);
}


user15740: The Yun makes communication between the microprocessor and the Linux side easy.  On the Arduino side, use the Bridge library in your "processing script" to read (or write) Bridge values set by the python program running on the Linux side.  From the linux side, the bridge looks like a web address and you set values by addressing a URL with a get or put url http request. You can also manipulate these values from another computer on the network as well if you like.
I have some Arduino Yun dataloggers that use the Linux side to communicate via wifi with an ftp server that serves several Yun dataloggers. The arduino script reads the sensors, creates the records, etc. You can also have the microprocessor side write files that are used by the linux side of the Yun. 
I find the Yun's combination of Linux and the regular arduino in one package makes the overall system easier to program and to interface with the rest of the web.

15045: <p>The linux processor runs a Python script from which I would like to send an array of integers to the Yun microprocessor. How can I do that?</p>

<p>And then, how can I retrieve and then use this array in my Arduino Sketch?</p>
 15045: <p>Given that my Python script printed the following</p>

<pre><code>[10, 20, 30, 40]
</code></pre>

<p>This is the sketch I used to retrieve the array</p>

<pre><code>#include &lt;Bridge.h&gt;
#include &lt;Process.h&gt;

void setup()
{
   Bridge.begin();
   Serial.begin(19200);
}

void loop()
{
   Process proc;
   int i=0;
   size_t dim = 1;
   int* array = (int*)malloc(dim);


   Serial.print("Running process...");
   Serial.println("done!");
   proc.runShellCommand("python /script.py");

   while (proc.available()){
     if((char)proc.read() != ']'){
        array[i] = proc.parseInt();
        dim++;
        array = (int*)realloc(array,dim);
        Serial.println(array[i]);
        i++;
      }
      else
        break;
   }

   Serial.println();
   delay(1000);
}
</code></pre>
 15740: <p>The Yun makes communication between the microprocessor and the Linux side easy.  On the Arduino side, use the Bridge library in your "processing script" to read (or write) Bridge values set by the python program running on the Linux side.  From the linux side, the bridge looks like a web address and you set values by addressing a URL with a get or put url http request. You can also manipulate these values from another computer on the network as well if you like.</p>

<p>I have some Arduino Yun dataloggers that use the Linux side to communicate via wifi with an ftp server that serves several Yun dataloggers. The arduino script reads the sensors, creates the records, etc. You can also have the microprocessor side write files that are used by the linux side of the Yun. </p>

<p>I find the Yun's combination of Linux and the regular arduino in one package makes the overall system easier to program and to interface with the rest of the web.</p>
