diff --git a/src/counter.rs b/src/counter.rs index fbfcde8..82c2033 100644 --- a/src/counter.rs +++ b/src/counter.rs @@ -4,9 +4,9 @@ use rppal::gpio::{Gpio, Trigger}; pub fn pulse_counter(pulses: Arc>) { let gpio = Gpio::new().expect("failt to get gpio driver"); - let mut pulse_gpio = gpio.get(15) + let mut pulse_gpio = gpio.get(23) .expect("failt to get gpio pin") - .into_input(); + .into_input_pullup(); pulse_gpio.set_interrupt(Trigger::FallingEdge, None) .expect("failt to set inerupt"); diff --git a/src/main.rs b/src/main.rs index 232fdfc..f0e2690 100644 --- a/src/main.rs +++ b/src/main.rs @@ -52,7 +52,7 @@ fn main() { match read_config() { Ok(conf) =>{ - let pulses: Arc> = Arc::new(AtomicCell::new(1)); + let pulses: Arc> = Arc::new(AtomicCell::new(0)); let pulses_counter = pulses.clone();