add digitalWrite functions

This commit is contained in:
Robert 2022-12-17 22:33:33 +01:00
parent 5e27c5f359
commit b284e2ebab
8 changed files with 295 additions and 19 deletions

21
examples/nightrider.rs Normal file
View file

@ -0,0 +1,21 @@
use std::{thread::sleep, time::Duration};
use b15f::b15f::B15F;
fn main() {
let mut drv = B15F::new().unwrap();
let mut position = 0;
let mut direction = 1;
loop {
drv.digital_write::<0>(1 << position);
position += direction;
if position >= 7 || position <= 0 {
direction *= -1;
}
sleep(Duration::from_millis(50));
}
}