OPHoperHPO / lilygo-ttgo-twatch-2020-micropython

:snake:MicroPython for LilyGO TTGO T-Watch-2020:snake:
MIT License
57 stars 12 forks source link

Wake from sleep issue #9

Open saibotd opened 3 years ago

saibotd commented 3 years ago

Very nice project! I have an issue with waking my device from sleep via the button like in examples/ttgo/axp202_pek_sleep.py. The failing line for me is probably this one: esp32.wake_on_ext1((machine.Pin(35), ), esp32.WAKEUP_ALL_LOW).

I tried to isolate the issue with some simple code:

import time
import machine

btn = machine.Pin(35, machine.Pin.IN)

def loop():
    while True:
        print({'btn': btn.value()})
        time.sleep_ms(50)

loop()

The value is always "1"… do you have any idea what's the problem or is the example code maybe not supposed to work?