def f():
led = digitalio.DigitalInOut(board.LED)
f()
After I called f()
pin was initialized, if led
was a global variable I could simply do led.uninit()
. But how do I uninit the pin that went out of scope?
Calling digitalio.DigitalInOut(board.LED).uninit()
gives 'ValueError: LED in use` error.
I know I can just reset the RP2040, but I want to learn how to do this programmatically.