rpi_i2c is a Dart package for using I2C on the Raspberry Pi.
Be sure to enable I2C on the Raspberry Pi using
RpiI2C uses a native library written in C. For security reasons, authors cannot publish binary content to pub.dartlang.org, so there are some extra steps necessary to compile the native library on the RPi before this package can be used. These two steps must be performed when you install and each time you upgrade the rpi_i2c package.
- Activate the rpi_i2c package using the pub global command.
pub global activate rpi_i2c
- From your application directory (the application that references the rpi_i2c package) run the following command to build the native library
pub global run rpi_i2c:build_lib
pub global activate makes the Dart scripts in the rpi_i2c/bin directory runnable from the command line. pub global run rpi_i2c:build_lib runs the rpi_i2c/bin/build_lib.dart program which in turn calls the build_lib script to compile the native librpi_i2c_ext.so library for the rpi_i2c package.