2 Replies Latest reply on Apr 12, 2015 2:22 PM by PalmerCliff

    How does the Intel Edison Arduino IDE search for .h files?

    PalmerCliff

      I downloaded the Seeedstudio Sketchbook Starter Kit and then tried to load and run the UltraDisOnSeeedSerialLcd.ino which appears in the sketchbook (libraries -> Grove Ultrasonic_Ranger_Master) using the Arduino IDE 1.60 which was included in the Intel iotdk and immediately ran into trouble locating the .h files. 

      The first include was SoftwareSerial.h, which the compile step was unable to locate.  I located it under <edison directory>\arduino-1.6.0+Intel\hardware\arduino\avr\libraries and copied the SoftwareSerial directory to the <edison directory>l\arduino-1.6.0+Intel\libraries directory.  The compile step seemed to locate it but then complained that an "avr/interrupt.h" could not be located.

      A brief search located four copies of the interupt.h file in various directories under <edison directory>\arduino-1.6.0+Intel\hardware\.  I decided against guessing which one to copy because they had different sizes and dates.

      It seems to me that I should not be copying files in order to make things work, but should rather know how to specify the location of the file I want.  This problem could be caused by poor code from the source, but the file specified in the include statement did exist.

      Could someone reply to this message with either an explanation of how to specify the location for include statements or a url which explains how to specify the location?  My question applies to the Arduino IDE v 1.60 included in the Intel iotdk_win_installer downloaded from Intel.  I don't need to know how include statements work in C, Java, Javascript, and other languages.

      Thanks in advance!

        • 1. Re: How does the Intel Edison Arduino IDE search for .h files?
          KurtE

          Someone from Intel or Arduino can probably answer this much better than I can.  There is a reasonable amount of documentation up on the web including FAQs and some new specifications on how libraries are to be setup.  Example: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification

           

          Couple of issues here.  How Arduino searches for Header files.  For the most part all libraries that are used by a sketch must be called out in the main sketch, including those which other libraries use.   The Arduino system, then tries to locate the appropriate library.   I do not remember the exact sequence that it searches, but it is something like:

          a) Maybe in sketch folder (may depend if #include is using <> or "" )

          b) In your Arduino Sketch folder/libraries

           

          Now I am a bit unsure in order

          c) Libraries contained in the specific Hardware libraries folder

          d) Arduino installation libraries folder

           

          A couple of notes:

          a) Not all libraries support all architectures: This is the case you are running into with SoftwareSerial - I don't believe a version has been implemented for the Edison (I could be wrong), which is why the system is not finding it.  Note, trying to use an AVR version for this will not work as I am very sure SoftwareSerial uses very AVR specific code like interrupts, registers and the like.

           

          b) There may be multiple implementations for the same library, which can lead to some issues. I believe the latest Arduino release 1.6.3 now will display a warning message when you do a compile and it finds multiple implementations (thanks to Paul of PJRC - Teensy)

           

          Again except for the issues associated with which libraries have been ported to the Edison, none of the library searching stuff is specific to Intel.

           

          Hope that helps

          Kurt

          • 2. Re: How does the Intel Edison Arduino IDE search for .h files?
            PalmerCliff

            Thanks KurtE for a very detailed and thorough answer.  Great information.