Teensy 4.1 Arduino external interrupt (pin interrupt) minimal example

In setup(), use

attachInterrupt(digitalPinToInterrupt(23), myInterrupt, RISING);

to configure the interrupt on Teensy Pin 23 on the RISING edge.

Add this function, which will be called during the interrupt:

void myInterrupt() {
  // Your code goes here
}