2 Replies Latest reply on Apr 8, 2015 8:22 AM by Intel_Peter

    Library for I2C Read/Write

    Galileo_User

      Hi All ,

       

      I am working on the I2C bus over Galileo board  and i don't want to use any arduino application for this purpose .  I want to make make an application in c . Is it possible to use the Wire Library of arduino in my c application  ?? if yes , how ? and if no , what are other alternatives.

       

      Regards ,

      Aditya

        • 1. Re: Library for I2C Read/Write
          mhahn

          if you use the Intel IoT development kit SD card image for Galileo you will find libmraa which abstracts GPIO, i2c, ... and supports C/C++, Python and Node.JS out of the box

          • 2. Re: Library for I2C Read/Write
            Intel_Peter

            Hello Galileo_User,

             

            To answer your question about if the Wire Library of Arduino can be used on a C application, well, the libraries included in Intel's Arduino IDE are .h and .cpp so I believe they could be used on a C application, however I believe they would have to be modified and would probably require work (maybe a lot) to make it work. That being said, there are a couple of alternatives, for example you could use MRAA to interact with I2; MRAA is a C/C++ library made to interact with the Galileo/Edison's I/O interface. You can learn more about MRAA here:

             

            mraa: Main Page

             

            Also you can check intel-iot-devkit/mraa · GitHub for some examples of using MRAA.

             

            Another way of using I2C would be using I2C-tools, which is a package you can get from AlexT's repo.

             

            Peter.