This is a cache of https://www.96boards.org/documentation/consumer/guides/mraa/i2c/. It is a snapshot of the page at 2024-09-19T01:45:32.890+0000.
Examples on how to use <strong>i2c</strong> using mraa library - 96Boards

Examples on how to use i2c using mraa library

Following examples are provided to use i2c using MRAA library.

  1. mraa_i2c.c
  2. mraa_i2c.cpp
  3. mraa_i2c.py

Usage:

Prerequisite: Debian running on 96Boards CE with libmraa installed

  • Copy the examples to 96Boards CE
  • Build the C/C++ examples:
    $ gcc mraa_i2c.c -o i2c_c
    $ g++ mraa_i2c.cpp -o i2c_c++
    
  • Execute the examples:
    $ sudo ./i2c_c
    $ sudo ./i2c_c++
    $ sudo python mraa_i2c.py
    

Expected Behaviour:

Checks for MPU6050 sensor at i2c bus 0.