Page 1 of 1

ESP32 Arduino Timer commands

Posted: Fri Jan 22, 2021 1:46 am
by Buleste
I'm trying to convert a project from Arduino Nano/Uno to ESP32 but I've hit a bit of a brick wall with timers.

I'm trying to find the equivalent commands to Arduino TimerOne but on the ESP32 using either the TimerInterrupt library or just raw code.

Timer1.initialize(period);
Timer1.attachInterrupt(wave);
Timer1.setPeriod(period);
Timer1.stop();
Timer1.restart();

I can find similar for the ESP32 IDF

timer_init(1000);
timer_enable_intr(wave);
timer_pause();


But struggling with the Arduino IDE.

Can anyone help?

Re: ESP32 Arduino Timer commands

Posted: Fri Jan 22, 2021 1:47 pm
by lbernstone

Re: ESP32 Arduino Timer commands

Posted: Sat Jan 23, 2021 6:36 pm
by Buleste
I have the ticker library but the documentation on it's usage is sparse at best so I don't know if it will actually do the job I want it to.