У меня ошибка при компиляции кода: esp_sleep_enable_ext0_wakeup 'не было объявлено в этой области. Как я могу исправить эту ошибку? Я использую WEMOS D1. Пожалуйста, помогите
int bootCount = 0;
void setup(){
Serial.begin(115200);
delay(1000);
//Increment boot number and print it every reboot
++bootCount;
Serial.println("Boot number: " + String(bootCount));
//Print the wakeup reason for ESP32
print_wakeup_reason();
//Configure GPIO33 as ext0 wake up source for HIGH logic level
esp_sleep_enable_ext0_wakeup(D4,1);
//Go to sleep now
esp_deep_sleep_start();
}
void loop(){}
//Function that prints the reason by which ESP32 has been awaken from sleep
void print_wakeup_reason(){
esp_sleep_wakeup_cause_t wakeup_reason;
wakeup_reason = esp_sleep_get_wakeup_cause();
switch(wakeup_reason)
{
case 1 : Serial.println("Wakeup caused by external signal using RTC_IO"); break;
case 2 : Serial.println("Wakeup caused by external signal using RTC_CNTL"); break;
case 3 : Serial.println("Wakeup caused by timer"); break;
case 4 : Serial.println("Wakeup caused by touchpad"); break;
case 5 : Serial.println("Wakeup caused by ULP program"); break;
default : Serial.println("Wakeup was not caused by deep sleep"); break;
}
}