You should put it inside of a timer isr so its execution is independent of loop() timing.
Except of course you should never have a delay in an interrupt service routine (ISR) and you should never have a print statement in an ISR.
You should put it inside of a timer isr so its execution is independent of loop() timing.
Except of course you should never have a delay in an interrupt service routine (ISR) and you should never have a print statement in an ISR.