我很擅长使用Arduino和任何类型的电路。
我正在尝试使用命令esp_sleep_enable_ext0_wakeup
设置ESP32板以使用外部触发器唤醒
void setup(){
int MY_PIN = 13;
pinMode(MY_PIN, INPUT_PULLUP);
int reading = digitalRead(MY_PIN);
if(reading == 1) {
esp_sleep_enable_ext0_wakeup(GPIO_NUM_13,0);
}
else {
esp_sleep_enable_ext0_wakeup(GPIO_NUM_13,1);
}
// I want the board to wake up every time the state of the switch changes.
esp_deep_sleep_start();
}
我遇到了麻烦。当我期待它时,唤醒不会发生。我认为这与使用外部上拉电阻有关。我没有连接一个。
有没有办法为此目的使用内部上拉电阻?
我很感激能解释这一点如何运作的人。
@note此功能不会修改引脚配置。在进入睡眠模式之前,该引脚在esp_sleep_start中配置。
也许我需要使用esp_sleep_pd_config
正确配置它。这可能是上拉电阻无法工作的原因吗?