mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 21:13:09 +00:00
add lifeline
This commit is contained in:
14
lifeline/src/main.rs
Normal file
14
lifeline/src/main.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
use std::time::Duration;
|
||||
|
||||
mod sound;
|
||||
|
||||
use sound::{notes::*, Song};
|
||||
|
||||
const SUCCESS_SONG: Song = Song(&[(Some(A_4), Duration::from_millis(100))]);
|
||||
|
||||
fn main() {
|
||||
std::fs::write("/sys/class/pwm/pwmchip0/export", "0").unwrap();
|
||||
let res = SUCCESS_SONG.play();
|
||||
std::fs::write("/sys/class/pwm/pwmchip0/unexport", "0").unwrap();
|
||||
res.unwrap();
|
||||
}
|
||||
Reference in New Issue
Block a user