2 Replies Latest reply on May 23, 2014 9:23 AM by Intel_Jesus

    Arduino and Linux at the same time

    Tom1988

      Hello,

       

      I recently bought a Galileo and have a general question? Can Arduino and Linux run at the same time? and how do they interact? Can I use an existing Arduino sketch to look after simple tasks like connect to wifi and take in sensor input via I2C. And can I use linux to do "other" more difficult tasks at the same time? Can I / How can I pass infomration from one to the other?

       

      Apologies if this question has already been answered.

       

      Tom

        • 1. Re: Arduino and Linux at the same time
          SpiderKenny

          Arduino is just a development IDE that creates a standard linux executable, and transfers it to Galileo.

          Galileo runs the program just like any other Linux program and it continues to run after you close down the Arduino IDE.

           

          Arduino IDE compiles your code to a program called 'sketch.elf' and then transfers that to the /Sketches folder on Galileo.

          There is no reason why you can't run other more difficult tasks at the same time.

          • 2. Re: Arduino and Linux at the same time
            Intel_Jesus

            Hi Tom1988,

             

            To communicate from Linux to the Arduino Sketch, you can either read and write to a file or use sockets. For example, I am running a node.js server and communicating via sockets to the Arduino sketch. I have also communicated from a Python script and a sketch.To run Linux commands from the sketch you can use system("your command");. Your question "Can I use linux to do "other" more difficult tasks at the same time?" can you give an example?

             

            Regards,

            Intel_Jesus