rpi_gpio 0.2.2

  • README.md
  • Installing
  • Versions
  • 30


pub package Build Status Coverage Status

rpi_gpio is a Dart library for accessing the Raspberry Pi GPIO pins.


  • Gpio provides a high level API for accessing the various General Purpose I/O pins on the Raspberry Pi.

  • RpiHardware provides a low level API for accessing the GPIO pins.


The rpi_gpio library accesses the GPIO pins using a native library written in C and built on top of the wiringPi library. 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_gpio package.

  1. Activate the rpi_gpio package using the pub global command.
    pub global activate rpi_gpio
  1. From your application directory (the application that references the rpi_gpio package) run the following command to build the native library
    pub global run rpi_gpio:build_lib

pub global activate makes the Dart scripts in the rpi_gpio/bin directory runnable from the command line. pub global run rpi_gpio:build_lib runs the rpi_gpio/bin/build_lib.dart program which in turn calls the build_lib script to compile the native librpi_gpio_ext.so library for the rpi_gpio package.




  • update wiringPi native code for Pi v2
  • add top level pin function and deprecated Gpio.pin method
  • add gpioNum method to return GPIO number for pin
  • rework isRaspberryPi to check /etc/os-release
  • rework and simplify examples


  • fix bug to track both rising and falling interrupt edge
  • fix bug that prevented application from completing normally when interrupts were used
  • switch tests to use package:test rather than package:unittest
  • fix read, polling, and interrupts examples to wait for rpi.loadLibrary() before proceeding.


  • Support for interrupts via Pin.events
  • Rename pin to pinNum
  • Improve build native library script
  • Rename repo to danrubel/rpi_gpio.dart


  • Read and write digital values
  • Hardware pulse width modulation on pin 1
  • Software simulated pwm for other pins (work in progress)

1. Depend on it

Add this to your package's pubspec.yaml file:

  rpi_gpio: "^0.2.2"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:rpi_gpio/rpi_gpio.dart';
Version Uploaded Documentation Archive
0.2.2 Dec 25, 2015 Go to the documentation of rpi_gpio 0.2.2 Download rpi_gpio 0.2.2 archive
0.2.1+1 Aug 23, 2015 Go to the documentation of rpi_gpio 0.2.1+1 Download rpi_gpio 0.2.1+1 archive
0.2.1 Jul 18, 2015 Go to the documentation of rpi_gpio 0.2.1 Download rpi_gpio 0.2.1 archive
0.2.0 Jul 15, 2015 Go to the documentation of rpi_gpio 0.2.0 Download rpi_gpio 0.2.0 archive
0.1.0 Apr 28, 2015 Go to the documentation of rpi_gpio 0.1.0 Download rpi_gpio 0.1.0 archive
0.3.0-dev.1 Jan 2, 2016 Go to the documentation of rpi_gpio 0.3.0-dev.1 Download rpi_gpio 0.3.0-dev.1 archive
0.2.0-alpha.2 Jul 5, 2015 Go to the documentation of rpi_gpio 0.2.0-alpha.2 Download rpi_gpio 0.2.0-alpha.2 archive
0.2.0-alpha.1 Jun 23, 2015 Go to the documentation of rpi_gpio 0.2.0-alpha.1 Download rpi_gpio 0.2.0-alpha.1 archive
0.2.0-alpha.0 Jun 14, 2015 Go to the documentation of rpi_gpio 0.2.0-alpha.0 Download rpi_gpio 0.2.0-alpha.0 archive


We analyzed this package on Mar 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.31.0
  • pana: 0.10.3


Describes how popular the package is relative to other packages. [more]
0 / 100
Code health derived from static analysis. [more]
100 / 100
Reflects how tidy and up-to-date the package is. [more]
0 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: Flutter, other

Primary library: package:rpi_gpio/rpi_gpio.dart with components: io.


  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use rpi_gpio.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.0.0 <2.0.0
path >=1.0.0 <2.0.0 1.5.1
Dev dependencies
grinder >=0.7.0 <0.8.0
test >=0.12.0 <0.13.0