overlay/pi-sensors: fix by initially outputting high to not confuse the sensor

This commit is contained in:
Astro 2022-07-01 19:42:28 +02:00
parent 274945f951
commit 0312e1b730
1 changed files with 3 additions and 2 deletions

View File

@ -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,
}
}