Arduino Nano 33 IoT ESP32-S3 Timer Interrupts

This code also works. But I can't figure out how could I tweak it to match my needs and implement it in my project.