6 Replies Latest reply on Feb 19, 2014 3:56 PM by Clayton Hofrock

    libraries question

    sherif-ezallo

      When i bought arduino Galileo i thought that i will burn the same UNO code and get me code faster ,
      But unfortunately , I realized that Galileo doesn't support all libraries .
      For example ,when i burn "MPU-6050" library i get this error ( the library is attached )

       

       

      Arduino: 1.5.3 (Windows 7), Board: "Intel® Galileo"

       

      In file included from MPU6050_DMP6.ino:48:0:

      C:\arduino-1.5.3\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:47:30: fatal error: avr/pgmspace.h: No such file or directory

      compilation terminated.

       

        This report would have more information with

        "Show verbose output during compilation"

        enabled in File > Preferences.
      So, any one can help me get these libraries working , I'm not very expert with coding so how can i convert the libraries to be  compatible with Galileo with simple steps !


        • 1. Re: libraries question
          rmm200

          If you search this forum, another user posted a version of avr/pgmspace.h along with instructions on where to copy it. Anything in the avr directory is hardware specific to atmel chips, so this is a workaround.

          1 of 1 people found this helpful
          • 2. Re: libraries question
            sherif-ezallo

            thanks for your answer, but can you refer to thie link here !
            do you think if i copied this avr/pgmspace.h in the right place the libraries will work ?

            • 3. Re: libraries question
              sherif-ezallo

              Fortunately i found the link here Re: Missing avr/pgmspace.h

              and i downloaded the file from here https://github.com/mikalhart/galileo-Pgmspace.h/

              the error is changed but still there's error :

               

              Arduino: 1.5.3 (Windows 7), Board: "Intel® Galileo"

               

              MPU6050_DMP6.ino: In function 'void setup()':

              MPU6050_DMP6.ino:165:9: error: 'TWBR' was not declared in this scope

               

                This report would have more information with

                "Show verbose output during compilation"

                enabled in File > Preferences.

               

              I also tried to comment the word 'TWBR' from the code , the error changed to be :


              Arduino: 1.5.3 (Windows 7), Board: "Intel® Galileo"

               

              C:\arduino-1.5.3\libraries\I2Cdev\I2Cdev.cpp: In static member function 'static int8_t I2Cdev::readBytes(uint8_t, uint8_t, uint8_t, uint8_t*, uint16_t)':

              C:\arduino-1.5.3\libraries\I2Cdev\I2Cdev.cpp:276:75: error: 'min' was not declared in this scope

              C:\arduino-1.5.3\libraries\I2Cdev\I2Cdev.cpp: In static member function 'static int8_t I2Cdev::readWords(uint8_t, uint8_t, uint8_t, uint16_t*, uint16_t)':

              C:\arduino-1.5.3\libraries\I2Cdev\I2Cdev.cpp:414:83: error: 'min' was not declared in this scope

               

              This report would have more information with

                "Show verbose output during compilation"

                enabled in File > Preferences.

               

               

               

              Be in mind that this code has no error on UNO

              • 4. Re: libraries question
                Clayton Hofrock

                The first error, caused by not finding TWBR is most likely caused by the wire library (wire.h).  Arduino Playground - WireLibraryDetailedReference

                 

                This is another Arduino specific library, but I don't think that there is a work around for this library.

                 

                Your next problem, with the min function, does have a work around. Re: Min() not declared in this scope

                • 5. Re: libraries question
                  sherif-ezallo

                  And what about the rest of the error :

                   

                  C:\arduino-1.5.3\libraries\I2Cdev\I2Cdev.cpp: In static member function 'static int8_t I2Cdev::readBytes(uint8_t, uint8_t, uint8_t, uint8_t*, uint16_t)':

                  C:\arduino-1.5.3\libraries\I2Cdev\I2Cdev.cpp:276:75: error: 'min' was not declared in this scope

                  C:\arduino-1.5.3\libraries\I2Cdev\I2Cdev.cpp: In static member function 'static int8_t I2Cdev::readWords(uint8_t, uint8_t, uint8_t, uint16_t*, uint16_t)':

                  • 6. Re: libraries question
                    Clayton Hofrock

                    Both of those errors were due to the min function not being declared.

                     

                    If you add a min function to your sketch, the error will go away.