I can cycle between 3.3v and 0v, but as soon as I try to PULL.HOLD the pin before sleep, followed by deepsleep the pin then goes to 2.5v and stays at that voltage until the board wakes up and then cycles the pin state between 3.3v and 0v again.
If anyone can offer me any advice on where I am going wrong would be grateful, thanks.
Code: Select all
import time from machine import Pin from machine import deepsleep pn0 = Pin(23, Pin.OUT) print("Initial Pin value = ", pn0.value()) for n in range (2): pn0.on() print("Pin value = ", pn0.value()) time.sleep(3) pn0.off() print("Pin value = ", pn0.value()) time.sleep(3) pn0 = Pin(23, pull=Pin.PULL_HOLD) time.sleep(0.5) print("Sleeping!") deepsleep(10_000)