用户工具

站点工具


micropython:主要硬件平台:esp32:从deepsleep唤醒

deepsleep可以通过下面几种方式唤醒:

  • 触摸键,esp32.wakeontouch(wake)
  • 一个引脚电平,esp32.wakeonext0(pin, level)
  • 多个引脚电平组合,esp32.wakeonext1(pins, level)

触摸键

from machine import TouchPad, Pin, deepsleep
import esp32
t = TouchPad(Pin(14))
t.config(500) # configure the threshold at which the pin is considered touched
esp32.wake_on_touch(True)
deepsleep()

引脚电平变化

from machine import Pin, deepsleep
import esp32
pin0 = Pin(0, Pin.IN, pull=Pin.PULL_UP)
esp32.wake_on_ext0(pin0, esp32.WAKEUP_ALL_LOW)
deepsleep()


purge    随机主题   
micropython/主要硬件平台/esp32/从deepsleep唤醒.txt · 最后更改: 2021/02/28 23:12 (外部编辑) · 查看次数: 12753