Thursday, 18 June 2015

Dart POW - ( Package Of The Week) #8 : rpi_gpio

Who is ready for another - Dart POW? A weekly look at an interesting Package on pub.dartlang.org

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

Code snippet:

...
main() async {
  Gpio.hardware = new RpiHardware();
  var gpio = Gpio.instance;
  var pin = gpio.pin(1, output);
  for (int count = 0; count < 5; ++count) {
    pin.value = 1;
    await _delay(1000);
    pin.value = 0;
    await _delay(1000);
  }
}
...

Feel free to leave a comment with suggestions for the next Dart POW post! Don't be too shy to suggest your own package :-)