use rust_gpiozero::*;
use std::thread::sleep;
use std::time::Duration;
fn main() {
let mut yellow = LED::new(21);
let mut red = LED::new(26);
loop{
red.on();
yellow.off();
sleep(Duration::from_millis(200));
yellow.on();
sleep(Duration::from_millis(200));
red.off();
sleep(Duration::from_millis(200));
}
}
Once pressing Ctrl+C the program is exit but the Led still on, even if I removed the wire and returned it, to the GPIO it still on!
Hi,
I just wrote my first prgram:
Once pressing
Ctrl+C
the program is exit but the Led still on, even if I removed the wire and returned it, to the GPIO it still on!