-
Couldn't load subscription status.
- Fork 101
Open
Description
The state of the an output is not persistent. The code below will set GPIO pin 0 to high. I expected the pin to stay high after this little script has finished. But that is not the case. I found out that the value of the pin drops to low when Python leaves the context manager.
When Python leaves the context manager, PinApi.close() is called and this method eventually changes the direction of the pin to input.
from quick2wire.gpio import pins, Out
from time import sleep
with pins.pin(0, direction=Out) as pin:
pin.value = 1
sleep(1)
# Pin drops to low.
Metadata
Metadata
Assignees
Labels
No labels