From 0312e1b730697156bae1c26154361e43bb941e43 Mon Sep 17 00:00:00 2001 From: Astro Date: Fri, 1 Jul 2022 19:42:28 +0200 Subject: [PATCH] overlay/pi-sensors: fix by initially outputting high to not confuse the sensor --- overlay/pi-sensors/src/open_pin.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/overlay/pi-sensors/src/open_pin.rs b/overlay/pi-sensors/src/open_pin.rs index 55464f81..0f4476f0 100644 --- a/overlay/pi-sensors/src/open_pin.rs +++ b/overlay/pi-sensors/src/open_pin.rs @@ -12,11 +12,12 @@ pub struct OpenPin { impl OpenPin { pub fn new(mut pin: IoPin) -> OpenPin { - pin.set_mode(Mode::Input); + pin.set_mode(Mode::Output); + pin.set_high(); pin.set_pullupdown(PullUpDown::Off); OpenPin { iopin: pin, - mode: Mode::Input, + mode: Mode::Output, } }