Can't wakeup esp32c3 after deepsleep or light sleep by pin
Posted: Sat Jul 24, 2021 3:23 pm
Recently,I want to test sleep and wake up function on esp32c3,here is my code:
import machine,esp32
from machine import Pin
import time
wake1 = Pin(2, mode = Pin.IN)
#level parameter can be: esp32.WAKEUP_ANY_HIGH or esp32.WAKEUP_ALL_LOW
esp32.wake_on_ext0(pin = wake1, level = esp32.WAKEUP_ALL_LOW)
print('Im awake. Going to sleep in 2 seconds')
time.sleep(2)
print('Going to sleep now')
time.sleep_ms(100)
machine.lightsleep()
it works on esp32,but when i try to test in on esp32c3, it sleep and won't wake up by pin pushed.
How to wake up correclty on esp32c3?
what's the problem?
import machine,esp32
from machine import Pin
import time
wake1 = Pin(2, mode = Pin.IN)
#level parameter can be: esp32.WAKEUP_ANY_HIGH or esp32.WAKEUP_ALL_LOW
esp32.wake_on_ext0(pin = wake1, level = esp32.WAKEUP_ALL_LOW)
print('Im awake. Going to sleep in 2 seconds')
time.sleep(2)
print('Going to sleep now')
time.sleep_ms(100)
machine.lightsleep()
it works on esp32,but when i try to test in on esp32c3, it sleep and won't wake up by pin pushed.
How to wake up correclty on esp32c3?
what's the problem?