Closed
Description
Are there any examples of hardware timers for Arduino IDE? I have used ESP32 hw timers a lot, but can't make since of them in the ESP32.
I need to sample the adc a a specified rate. I would like to attachinterrupt to and ISR. Here is what I'm doing in the ESP8266. How do I do this in the ESP32?
void timer_init(void) {
timer1_isr_init();
timer1_attachInterrupt(sample_isr);
timer1_enable(TIM_DIV1, TIM_EDGE, TIM_LOOP);
timer1_write(8333); //9600 samples/s
}
void ICACHE_RAM_ATTR sample_isr() {
...do some stuff
}
Thanks!
Metadata
Metadata
Assignees
Labels
No labels