Created
August 3, 2015 21:48
-
-
Save inre/f3a536686f35b1934d43 to your computer and use it in GitHub Desktop.
gpio-pi: Blink example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate gpio_pi; | |
use std::thread; | |
use gpio_pi::Gpio; | |
// use gpio::sys::Gpio; | |
fn main() { | |
let gpio = Gpio::new().unwrap(); | |
let pinopt = gpio.pin(17); | |
let pin = pinopt.output(); | |
for _ in 0..20 { | |
pin.high(); | |
thread::sleep_ms(600); | |
pin.low(); | |
thread::sleep_ms(600); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment