ESP32 Arduino is too old and the timer API is not match the ESP32-Arduino Document

in esp32-hal-timer.h
timerBegin function is:
hw_timer_t * timerBegin(uint8_t timer, uint16_t divider, bool countUp);
but at the document:

timerBegin

This function is used to configure the timer. After successful setup the timer will automatically start.

hw_timer_t * timerBegin(uint32_t frequency);

  • frequency select timer frequency in Hz. Sets how quickly the timer counter is “ticking”.

This function will return timer structure if configuration is successful. If NULL is returned, error occurs and the timer was not configured.

You are comparing Espressif Arduino 2.x against 3.x!

To get the latest Espressif Arduino 3.x try pioarduino.

1 Like