fn pin_read_fn_factory(pin_num: u64) -> Box<dyn Fn() -> GpioPinValue> {
    Box::from(move || {
        let pin = Pin::new(pin_num);
        pin.export().unwrap();
        pin.set_direction(Direction::In).unwrap();
        let res = pin.get_value().unwrap();
        return if res == 0 { GpioPinValue::LOW } else { GpioPinValue::HIGH }
    })
}
/// Creates a function/closure for the given pin that reads its value in the moment of invocation.
Creates a function/closure for the given pin that reads its value in the moment of invocation.
Creates a function / closure for the given pin that reads its value in the moment of invocation .
fn pin_read_fn_factory(pin_num: u64) -> Box<dyn Fn() -> GpioPinValue> {
    Box::from(move || {
        let pin = Pin::new(pin_num);
        pin.export().unwrap();
        pin.set_direction(Direction::In).unwrap();
        let res = pin.get_value().unwrap();
        return if res == 0 { GpioPinValue::LOW } else { GpioPinValue::HIGH }
    })
}
fn pin_read_fn_factory ( pin_num : u64 ) -> Box < dyn Fn ( ) -> GpioPinValue > { Box :: from ( move | | { let pin = Pin :: new ( pin_num ) ; pin . export ( ) . unwrap ( ) ; pin . set_direction ( Direction :: In ) . unwrap ( ) ; let res = pin . get_value ( ) . unwrap ( ) ; return if res == 0 { GpioPinValue :: LOW } else { GpioPinValue :: HIGH } } ) }
Creates a function/closure for the given pin that reads its value in the moment of invocation.
Creates a function / closure for the given pin that reads its value in the moment of invocation .
pin_num
u64