Ошибка при компиляции проекта

Всем привет

Могу разобраться в чём ошибка. Установил библиотеку ESP32_ESP32S2_AnalogWrite, из этой библиотеки запускаю пример Servo_Sweep.ino
В итоге вываливается ошибка :

c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp: In member function 'uint8_t Pwm::attach(int)':
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:55:9: error: 'ledcSetup' was not declared in this scope; did you mean 'ledc_stop'?
   55 |         ledcSetup(ch, mem[ch].frequency, mem[ch].resolution);
      |         ^~~~~~~~~
      |         ledc_stop
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:57:9: error: 'ledcAttachPin' was not declared in this scope; did you mean 'ledcAttach'?
   57 |         ledcAttachPin(pin, ch);
      |         ^~~~~~~~~~~~~
      |         ledcAttach
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp: In member function 'uint8_t Pwm::attach(int, int)':
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:68:5: error: 'ledcSetup' was not declared in this scope; did you mean 'ledc_stop'?
   68 |     ledcSetup(ch, mem[ch].frequency, mem[ch].resolution);
      |     ^~~~~~~~~
      |     ledc_stop
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:70:5: error: 'ledcAttachPin' was not declared in this scope; did you mean 'ledcAttach'?
   70 |     ledcAttachPin(pin, ch);
      |     ^~~~~~~~~~~~~
      |     ledcAttach
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp: In member function 'uint8_t Pwm::attachInvert(int)':
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:78:3: error: 'ledcSetup' was not declared in this scope; did you mean 'ledc_stop'?
   78 |   ledcSetup(ch, mem[ch].frequency, mem[ch].resolution);
      |   ^~~~~~~~~
      |   ledc_stop
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp: In member function 'uint8_t Pwm::attachInvert(int, int)':
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:87:5: error: 'ledcSetup' was not declared in this scope; did you mean 'ledc_stop'?
   87 |     ledcSetup(ch, mem[ch].frequency, mem[ch].resolution);
      |     ^~~~~~~~~
      |     ledc_stop
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp: In member function 'float Pwm::writeServo(int, float)':
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:180:9: error: 'ledcSetup' was not declared in this scope; did you mean 'ledc_stop'?
  180 |         ledcSetup(ch, mem[ch].frequency, mem[ch].resolution);
      |         ^~~~~~~~~
      |         ledc_stop
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:182:9: error: 'ledcAttachPin' was not declared in this scope; did you mean 'ledcAttach'?
  182 |         ledcAttachPin(pin, ch);
      |         ^~~~~~~~~~~~~
      |         ledcAttach
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp: In member function 'void Pwm::detach(int)':
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:253:5: error: 'ledcDetachPin' was not declared in this scope; did you mean 'ledcDetach'?
  253 |     ledcDetachPin(mem[ch].pin); // jitterless
      |     ^~~~~~~~~~~~~
      |     ledcDetach
In file included from C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/esp_common/include/esp_macros.h:13,
                 from C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:51,
                 from C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/freertos/FreeRTOS-Kernel/include/freertos/portable.h:57,
                 from C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/freertos/FreeRTOS-Kernel/include/freertos/FreeRTOS.h:69,
                 from C:\Users\30609\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.1.1\cores\esp32/Arduino.h:33,
                 from c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:7:
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:254:19: error: 'GPIO_PIN_MUX_REG' was not declared in this scope; did you mean 'GPIO_PIN19_REG'?
  254 |     REG_SET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL, GPIO_MODE_DEF_DISABLE);
      |                   ^~~~~~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/esp_common/include/esp_assert.h:25:38: note: in definition of macro 'TRY_STATIC_ASSERT'
   25 |             if (__builtin_constant_p(CONDITION) && !(CONDITION)) {          \
      |                                      ^~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:35:57: note: in expansion of macro 'IS_DPORT_REG'
   35 | #define ASSERT_IF_DPORT_REG(_r, OP)  TRY_STATIC_ASSERT(!IS_DPORT_REG(_r), (Cannot use OP for DPORT registers use DPORT_##OP));
      |                                                         ^~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:84:13: note: in expansion of macro 'ASSERT_IF_DPORT_REG'
   84 |             ASSERT_IF_DPORT_REG((_r), REG_SET_FIELD);                                                                  \
      |             ^~~~~~~~~~~~~~~~~~~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:254:5: note: in expansion of macro 'REG_SET_FIELD'
  254 |     REG_SET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL, GPIO_MODE_DEF_DISABLE);
      |     ^~~~~~~~~~~~~
In file included from C:/Users/30609/AppData/Local/Arduino15/packages/esp32/tools/esp-x32/2405/xtensa-esp-elf/include/sys/reent.h:458,
                 from C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/newlib/platform_include/sys/reent.h:22,
                 from C:/Users/30609/AppData/Local/Arduino15/packages/esp32/tools/esp-x32/2405/xtensa-esp-elf/include/stdio.h:60,
                 from C:\Users\30609\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.1.1\cores\esp32/Arduino.h:27:
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:254:19: error: 'GPIO_PIN_MUX_REG' was not declared in this scope; did you mean 'GPIO_PIN19_REG'?
  254 |     REG_SET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL, GPIO_MODE_DEF_DISABLE);
      |                   ^~~~~~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:35:38: note: in expansion of macro 'TRY_STATIC_ASSERT'
   35 | #define ASSERT_IF_DPORT_REG(_r, OP)  TRY_STATIC_ASSERT(!IS_DPORT_REG(_r), (Cannot use OP for DPORT registers use DPORT_##OP));
      |                                      ^~~~~~~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:35:57: note: in expansion of macro 'IS_DPORT_REG'
   35 | #define ASSERT_IF_DPORT_REG(_r, OP)  TRY_STATIC_ASSERT(!IS_DPORT_REG(_r), (Cannot use OP for DPORT registers use DPORT_##OP));
      |                                                         ^~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:84:13: note: in expansion of macro 'ASSERT_IF_DPORT_REG'
   84 |             ASSERT_IF_DPORT_REG((_r), REG_SET_FIELD);                                                                  \
      |             ^~~~~~~~~~~~~~~~~~~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:254:5: note: in expansion of macro 'REG_SET_FIELD'
  254 |     REG_SET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL, GPIO_MODE_DEF_DISABLE);
      |     ^~~~~~~~~~~~~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:254:19: error: 'GPIO_PIN_MUX_REG' was not declared in this scope; did you mean 'GPIO_PIN19_REG'?
  254 |     REG_SET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL, GPIO_MODE_DEF_DISABLE);
      |                   ^~~~~~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/esp_common/include/esp_assert.h:25:38: note: in definition of macro 'TRY_STATIC_ASSERT'
   25 |             if (__builtin_constant_p(CONDITION) && !(CONDITION)) {          \
      |                                      ^~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:35:57: note: in expansion of macro 'IS_DPORT_REG'
   35 | #define ASSERT_IF_DPORT_REG(_r, OP)  TRY_STATIC_ASSERT(!IS_DPORT_REG(_r), (Cannot use OP for DPORT registers use DPORT_##OP));
      |                                                         ^~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:42:13: note: in expansion of macro 'ASSERT_IF_DPORT_REG'
   42 |             ASSERT_IF_DPORT_REG((_r), REG_WRITE);                                                                      \
      |             ^~~~~~~~~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:85:13: note: in expansion of macro 'REG_WRITE'
   85 |             REG_WRITE((_r),((REG_READ(_r) & ~((_f##_V) << (_f##_S)))|(((_v) & (_f##_V))<<(_f##_S))));                  \
      |             ^~~~~~~~~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:254:5: note: in expansion of macro 'REG_SET_FIELD'
  254 |     REG_SET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL, GPIO_MODE_DEF_DISABLE);
      |     ^~~~~~~~~~~~~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:254:19: error: 'GPIO_PIN_MUX_REG' was not declared in this scope; did you mean 'GPIO_PIN19_REG'?
  254 |     REG_SET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL, GPIO_MODE_DEF_DISABLE);
      |                   ^~~~~~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:35:38: note: in expansion of macro 'TRY_STATIC_ASSERT'
   35 | #define ASSERT_IF_DPORT_REG(_r, OP)  TRY_STATIC_ASSERT(!IS_DPORT_REG(_r), (Cannot use OP for DPORT registers use DPORT_##OP));
      |                                      ^~~~~~~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:35:57: note: in expansion of macro 'IS_DPORT_REG'
   35 | #define ASSERT_IF_DPORT_REG(_r, OP)  TRY_STATIC_ASSERT(!IS_DPORT_REG(_r), (Cannot use OP for DPORT registers use DPORT_##OP));
      |                                                         ^~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:42:13: note: in expansion of macro 'ASSERT_IF_DPORT_REG'
   42 |             ASSERT_IF_DPORT_REG((_r), REG_WRITE);                                                                      \
      |             ^~~~~~~~~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:85:13: note: in expansion of macro 'REG_WRITE'
   85 |             REG_WRITE((_r),((REG_READ(_r) & ~((_f##_V) << (_f##_S)))|(((_v) & (_f##_V))<<(_f##_S))));                  \
      |             ^~~~~~~~~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:254:5: note: in expansion of macro 'REG_SET_FIELD'
  254 |     REG_SET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL, GPIO_MODE_DEF_DISABLE);
      |     ^~~~~~~~~~~~~
In file included from C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/esp_hw_support/include/esp_memory_utils.h:12,
                 from C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:54:
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:254:19: error: 'GPIO_PIN_MUX_REG' was not declared in this scope; did you mean 'GPIO_PIN19_REG'?
  254 |     REG_SET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL, GPIO_MODE_DEF_DISABLE);
      |                   ^~~~~~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:43:37: note: in definition of macro 'REG_WRITE'
   43 |             (*(volatile uint32_t *)(_r)) = (_v);                                                                       \
      |                                     ^~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:254:5: note: in expansion of macro 'REG_SET_FIELD'
  254 |     REG_SET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL, GPIO_MODE_DEF_DISABLE);
      |     ^~~~~~~~~~~~~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:254:42: error: 'MCU_SEL_V' was not declared in this scope
  254 |     REG_SET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL, GPIO_MODE_DEF_DISABLE);
      |                                          ^~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:43:45: note: in definition of macro 'REG_WRITE'
   43 |             (*(volatile uint32_t *)(_r)) = (_v);                                                                       \
      |                                             ^~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:254:5: note: in expansion of macro 'REG_SET_FIELD'
  254 |     REG_SET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL, GPIO_MODE_DEF_DISABLE);
      |     ^~~~~~~~~~~~~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:254:42: error: 'MCU_SEL_S' was not declared in this scope
  254 |     REG_SET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL, GPIO_MODE_DEF_DISABLE);
      |                                          ^~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:43:45: note: in definition of macro 'REG_WRITE'
   43 |             (*(volatile uint32_t *)(_r)) = (_v);                                                                       \
      |                                             ^~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:254:5: note: in expansion of macro 'REG_SET_FIELD'
  254 |     REG_SET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL, GPIO_MODE_DEF_DISABLE);
      |     ^~~~~~~~~~~~~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp: In member function 'bool Pwm::detached(int)':
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:259:22: error: 'GPIO_PIN_MUX_REG' was not declared in this scope; did you mean 'GPIO_PIN19_REG'?
  259 |   if ((REG_GET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL)) == 0) return true;
      |                      ^~~~~~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/esp_common/include/esp_assert.h:25:38: note: in definition of macro 'TRY_STATIC_ASSERT'
   25 |             if (__builtin_constant_p(CONDITION) && !(CONDITION)) {          \
      |                                      ^~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:35:57: note: in expansion of macro 'IS_DPORT_REG'
   35 | #define ASSERT_IF_DPORT_REG(_r, OP)  TRY_STATIC_ASSERT(!IS_DPORT_REG(_r), (Cannot use OP for DPORT registers use DPORT_##OP));
      |                                                         ^~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:78:13: note: in expansion of macro 'ASSERT_IF_DPORT_REG'
   78 |             ASSERT_IF_DPORT_REG((_r), REG_GET_FIELD);                                                                  \
      |             ^~~~~~~~~~~~~~~~~~~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:259:8: note: in expansion of macro 'REG_GET_FIELD'
  259 |   if ((REG_GET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL)) == 0) return true;
      |        ^~~~~~~~~~~~~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:259:22: error: 'GPIO_PIN_MUX_REG' was not declared in this scope; did you mean 'GPIO_PIN19_REG'?
  259 |   if ((REG_GET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL)) == 0) return true;
      |                      ^~~~~~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:35:38: note: in expansion of macro 'TRY_STATIC_ASSERT'
   35 | #define ASSERT_IF_DPORT_REG(_r, OP)  TRY_STATIC_ASSERT(!IS_DPORT_REG(_r), (Cannot use OP for DPORT registers use DPORT_##OP));
      |                                      ^~~~~~~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:35:57: note: in expansion of macro 'IS_DPORT_REG'
   35 | #define ASSERT_IF_DPORT_REG(_r, OP)  TRY_STATIC_ASSERT(!IS_DPORT_REG(_r), (Cannot use OP for DPORT registers use DPORT_##OP));
      |                                                         ^~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:78:13: note: in expansion of macro 'ASSERT_IF_DPORT_REG'
   78 |             ASSERT_IF_DPORT_REG((_r), REG_GET_FIELD);                                                                  \
      |             ^~~~~~~~~~~~~~~~~~~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:259:8: note: in expansion of macro 'REG_GET_FIELD'
  259 |   if ((REG_GET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL)) == 0) return true;
      |        ^~~~~~~~~~~~~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:259:22: error: 'GPIO_PIN_MUX_REG' was not declared in this scope; did you mean 'GPIO_PIN19_REG'?
  259 |   if ((REG_GET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL)) == 0) return true;
      |                      ^~~~~~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/esp_common/include/esp_assert.h:25:38: note: in definition of macro 'TRY_STATIC_ASSERT'
   25 |             if (__builtin_constant_p(CONDITION) && !(CONDITION)) {          \
      |                                      ^~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:35:57: note: in expansion of macro 'IS_DPORT_REG'
   35 | #define ASSERT_IF_DPORT_REG(_r, OP)  TRY_STATIC_ASSERT(!IS_DPORT_REG(_r), (Cannot use OP for DPORT registers use DPORT_##OP));
      |                                                         ^~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:48:13: note: in expansion of macro 'ASSERT_IF_DPORT_REG'
   48 |             ASSERT_IF_DPORT_REG((_r), REG_READ);                                                                       \
      |             ^~~~~~~~~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:79:15: note: in expansion of macro 'REG_READ'
   79 |             ((REG_READ(_r) >> (_f##_S)) & (_f##_V));                                                                   \
      |               ^~~~~~~~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:259:8: note: in expansion of macro 'REG_GET_FIELD'
  259 |   if ((REG_GET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL)) == 0) return true;
      |        ^~~~~~~~~~~~~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:259:22: error: 'GPIO_PIN_MUX_REG' was not declared in this scope; did you mean 'GPIO_PIN19_REG'?
  259 |   if ((REG_GET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL)) == 0) return true;
      |                      ^~~~~~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:35:38: note: in expansion of macro 'TRY_STATIC_ASSERT'
   35 | #define ASSERT_IF_DPORT_REG(_r, OP)  TRY_STATIC_ASSERT(!IS_DPORT_REG(_r), (Cannot use OP for DPORT registers use DPORT_##OP));
      |                                      ^~~~~~~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:35:57: note: in expansion of macro 'IS_DPORT_REG'
   35 | #define ASSERT_IF_DPORT_REG(_r, OP)  TRY_STATIC_ASSERT(!IS_DPORT_REG(_r), (Cannot use OP for DPORT registers use DPORT_##OP));
      |                                                         ^~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:48:13: note: in expansion of macro 'ASSERT_IF_DPORT_REG'
   48 |             ASSERT_IF_DPORT_REG((_r), REG_READ);                                                                       \
      |             ^~~~~~~~~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:79:15: note: in expansion of macro 'REG_READ'
   79 |             ((REG_READ(_r) >> (_f##_S)) & (_f##_V));                                                                   \
      |               ^~~~~~~~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:259:8: note: in expansion of macro 'REG_GET_FIELD'
  259 |   if ((REG_GET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL)) == 0) return true;
      |        ^~~~~~~~~~~~~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:259:22: error: 'GPIO_PIN_MUX_REG' was not declared in this scope; did you mean 'GPIO_PIN19_REG'?
  259 |   if ((REG_GET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL)) == 0) return true;
      |                      ^~~~~~~~~~~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:49:37: note: in definition of macro 'REG_READ'
   49 |             (*(volatile uint32_t *)(_r));                                                                              \
      |                                     ^~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:259:8: note: in expansion of macro 'REG_GET_FIELD'
  259 |   if ((REG_GET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL)) == 0) return true;
      |        ^~~~~~~~~~~~~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:259:45: error: 'MCU_SEL_S' was not declared in this scope
  259 |   if ((REG_GET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL)) == 0) return true;
      |                                             ^~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:79:32: note: in definition of macro 'REG_GET_FIELD'
   79 |             ((REG_READ(_r) >> (_f##_S)) & (_f##_V));                                                                   \
      |                                ^~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:259:45: error: 'MCU_SEL_V' was not declared in this scope
  259 |   if ((REG_GET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL)) == 0) return true;
      |                                             ^~~~~~~
C:\Users\30609\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-cfea4f7c-v1\esp32/include/soc/esp32/include/soc/soc.h:79:44: note: in definition of macro 'REG_GET_FIELD'
   79 |             ((REG_READ(_r) >> (_f##_S)) & (_f##_V));                                                                   \
      |                                            ^~
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:259:55: error: invalid operands of types 'void' and 'int' to binary 'operator=='
  259 |   if ((REG_GET_FIELD(GPIO_PIN_MUX_REG[pin], MCU_SEL)) == 0) return true;
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~ ~
      |                                                          |
      |                                                          int
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp: In member function 'float Pwm::setFrequency(int, uint32_t)':
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:283:7: error: 'ledcSetup' was not declared in this scope; did you mean 'ledc_stop'?
  283 |       ledcSetup(ch, frequency, mem[ch].resolution);
      |       ^~~~~~~~~
      |       ledc_stop
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp: In member function 'uint8_t Pwm::setResolution(int, uint8_t)':
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:297:7: error: 'ledcSetup' was not declared in this scope; did you mean 'ledc_stop'?
  297 |       ledcSetup(ch, mem[ch].frequency, resolution);
      |       ^~~~~~~~~
      |       ledc_stop
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp: In member function 'void Pwm::wr_servo(int, float, double, double)':
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:376:9: error: 'ledcSetup' was not declared in this scope; did you mean 'ledc_stop'?
  376 |         ledcSetup(ch, mem[ch].frequency, mem[ch].resolution);
      |         ^~~~~~~~~
      |         ledc_stop
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:378:9: error: 'ledcAttachPin' was not declared in this scope; did you mean 'ledcAttach'?
  378 |         ledcAttachPin(pin, ch);
      |         ^~~~~~~~~~~~~
      |         ledcAttach
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp: In member function 'void Pwm::wr_freq_res(int, uint32_t, uint8_t)':
c:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:451:5: error: 'ledcSetup' was not declared in this scope; did you mean 'ledc_stop'?
  451 |     ledcSetup(ch, frequency, resolution);
      |     ^~~~~~~~~
      |     ledc_stop
Multiple libraries were found for "Servo.h"
  Used: C:\Users\30609\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite
  Not used: C:\Users\30609\AppData\Local\Arduino15\libraries\Servo
exit status 1

Compilation error: exit status 1

Уже и переустанавливал программу. Ничего не помогает и не могу скомпилировать скетч. В чем может быть причина?

Причём, не важно какое устройство выбираешь, ошибка всё та же.

Вот код из примера:

/*
  Controls servo position from 0-180 degrees and back
  https://wokwi.com/projects/350037178957431378
  by dlloydev, December 2022.
*/

#include <Servo.h>

Servo myservo = Servo();

const int servoPin = 5;

void setup() {
}

void loop() {
  for (int pos = 0; pos <= 180; pos++) {  // go from 0-180 degrees
    myservo.write(servoPin, pos);        // set the servo position (degrees)
    delay(15);
  }
  for (int pos = 180; pos >= 0; pos--) {  // go from 180-0 degrees
    myservo.write(servoPin, pos);        // set the servo position (degrees)
    delay(15);
  }
}

Мы только приветствуем, как разберётесь, расскажите нам.

Пакет кода ЕСП32 обновился и несовместим со старыми скетчами.
У вас ведь стоит ядро ЕСП версии 3 , верно?
Откатите ядро ЕСП32 до версии 2.0.х - и пробуйте

А разве в третьей версии ядра для ESP32 нет функции analogWrite()?

А как это сделать ?

там нет ни одной ошибки, связанной непосредственно с `analogWrite()

Потому что там ее и нету. Она только в третьей версии появилась

Если у вас Ардуино ИДЕ 1.х, то открываете Tools → Boards → Board manager

находите среди установленных пакетов ESP32 от Espressif и видите рядом с названием версию - см картинку


Если я угадал и установленная версия - третья, то выбираете другую версию (обведено красным) - и нажимаете установить

После установки лучше перезапустить ИДЕ