overlay/pi-sensors: fix by initially outputting high to not confuse the sensor
This commit is contained in:
parent
274945f951
commit
0312e1b730
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue