add lifeline

This commit is contained in:
Aiden McClelland
2020-12-24 14:33:38 -07:00
parent 69cfe3daf4
commit e8a693049e
7 changed files with 135 additions and 0 deletions

14
lifeline/src/main.rs Normal file
View 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();
}