Community
cancel
Showing results for 
Search instead for 
Did you mean: 
MStrz
Beginner
900 Views

and on Galileo Gen 1

Jump to solution

Hi when i use only # include its ok but when i try

# include

# include

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

 

0 Kudos
1 Solution
Diego_V_Intel
Employee
71 Views

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.

View solution in original post

1 Reply
Diego_V_Intel
Employee
72 Views

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.

View solution in original post

Reply