Replies: 1 comment 3 replies
-
You did not tell which board you use. Some boards like the Wemos D1 Mini have a pull-up resistor at Pin 2. So even when set to Input, pull-down, the level will be not 0. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Needed to flip the ESP8266 (ESP-07s module) pin 2 from output to input.
Using this version of micropython: v1.191(583K)
This is the example on micropython.org: (https://docs.micropython.org/en/latest/library/machine.Pin.html)
reconfigure pin #0 in input mode with a pull down resistor
p0.init(p0.IN, p0.PULL_DOWN)
Used the following instruction for my pin object: pin_2.init(pin_2.IN)
The pin remained an output; it did not change to an input.
Changed the instruction to this: pin_2(pin_2.IN).
This format changed the pin from output to input as needed.
Is the example on micropython.org wrong, or is there some other issue?
mm
Beta Was this translation helpful? Give feedback.
All reactions