Closed danrubel closed 6 years ago
For example, it should be easy to consume te the rpi_gpio package in order to drive hardware buttons and strips of LEDs.
import 'dart:math';
import 'package:rpi_gpio/rpi_gpio.dart';
Random random = new Random();
double next() => random.nextDouble();
void change(Strip led) {
led
..red = next()
..blue = next()
..green = next();
}
main() {
var led = new Strip(pin(1, output), pin(2, output), pin(3, output));
change(led);
new Button(pin(4, input), () => change(led));
}
New API published in version 0.5.0
gpio
accessor for obtaining the initialized Gpio instance for interacting with the GPIO pins running on the Raspberry Pi.pin
accessor for obtaining the initialized Gpio pin instancesnew Gpio(hardware)
constructor for mockingGpio.hardware =
setter in 0.2.x and remove it in subsequent release