Pin.PULL_HOLD with ESP32 DevKit DOIT problem - Does it work with deepsleep and Pin.OUT?
Posted: Sun May 16, 2021 8:54 am
I've been trying to get my ESP32 DevKit DOIT to go to deepsleep and maintain 0v on a pin.
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.
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)