forked from c3d2/nix-config
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 {
|
impl OpenPin {
|
||||||
pub fn new(mut pin: IoPin) -> 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);
|
pin.set_pullupdown(PullUpDown::Off);
|
||||||
OpenPin {
|
OpenPin {
|
||||||
iopin: pin,
|
iopin: pin,
|
||||||
mode: Mode::Input,
|
mode: Mode::Output,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user