The MicroPython docs at https://docs.micropython.org/en/latest/library/machine.Pin.html feature the following example:
from machine import Pin
# create an output pin on pin #0
p0 = Pin(0, Pin.OUT)
And then later:
# reconfigure pin #0 in input mode with a pull down resistor
p0.init(p0.IN, p0.PULL_DOWN)
Is there a difference between using machine.Pin.init
and just running the constructor again?
p0 = Pin(0, Pin.PULL_DOWN) # instead of p0.init(p0.IN, p0.PULL_DOWN) from above