We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I just wrote my first prgram:
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!
Ctrl+C
The text was updated successfully, but these errors were encountered:
hey there, Given that Rust doesn't catch ctrl-c or SIGTERM, you can use simple signal to handle those.
ctrl-c
You can check the example here and adapt it for your code
Sorry, something went wrong.
No branches or pull requests
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!The text was updated successfully, but these errors were encountered: