1 Reply Latest reply on Nov 16, 2015 8:17 AM by DiegoV_Intel

    <Wire.h> and <NXShield.h> on Galileo Gen 1

    3mortis

      Hi when  i use only #include <Wire.h> its ok but when i try

       

       

      #include <Wire.h>

      #include <NXShield.h>

       

      void setup() {

      }

       

      void loop() {

      }

       

      i get

      C:\Program Files (x86)\Arduino\libraries\NXShield\BaseI2CDevice.cpp:27:21: fatal error: avr/twi.h: No such file or directory

      compilation terminated.

       

       

      my nxshield-d is for the Arduino Uno so it is compatible with pins on Galileo, etc
      is a way to make it work? i need this to run 2 mindstorm motors

        • 1. Re: <Wire.h> and <NXShield.h> on Galileo Gen 1
          DiegoV_Intel

          Hello 3mortis,

           

          The error you are getting is because the file twi.h can't be found. However, the file twi.h is a library based on the AVR architecture. This means that it won’t work on Galileo because its architecture is different. That's the reason why the file can't be found. If you compile the same sketch for the Arduino UNO board, it shouldn't have errors because the twi.h file is available for the AVR architecture (Arduino boards).

           

          Therefore, the library NXShield.h is not compatible with Galileo because of the architecture dependencies. My suggestion would be to re-write the library. Check what the library NXShield.h does, and try to write a new one based on it.

           

          Another alternative would be to check for what purpose the library twi.h is used in the NXShield.h library. If it doesn’t have critical uses in the functionality of the NXShield.h library, you could comment the line where it is called to avoid getting the error message.

           

          Regards,

          Diego.