I am able to turn the Pin “LED” on and off successfully. When on or off calling value() in Python with no args returns 0. Per the docs it should return 1 when on and 0 when off. Why does it return 0 when ON?
Solved this by initializing it this way:
led = Pin( “LED”, Pin.OUT )
Then before calling value() did this:
led._mode = Pin.IN # change mode to Pin.IN
value = led.value()
led._mode = Pin.OUT # change mode back to Pin.OUT
That’s correct.
If you have any further questions or problems, please feel free to reach out to us via email at service@sunfounder.com