Outdated documentation on interrupts?

john celo

New member
Code here doesn't compile in Arduino 1.8.19, with Teensyduino 1.57

Code:
ISR(TIMER0_OVF_vect)
{
    /* Timer 0 overflow */
}

Error:
Code:
error: expected constructor, destructor, or type conversion before '(' token ISR(TIMER0_OVF_vect)

(trying to get an interrupt for a PWM signal generated by Teensy 4.1)
 
Yes this web page is way out of date! It is specific to AVR based boards like the old Teensy 2.x

Not sure what you are trying to do, so hard to suggest solutions. For example the TIMER0 is specific to the processor you are
using. I assume by name probably a timer. Would help if you posted additional code.

For T4.x you don't use the ISR tag...
Most interrupt handlers will simply look like;
Code:
void myInterruptHandler() {
    ...
}

PWM Signal?

Trying to generate? analogWrite()?

Trying to interrupt on when pin changes state? attachInterrupt(pin, ...)

Want an interrupt on an interval? use IntervalTimer object is the easiest.

Sorry I know, not much help
 
Back
Top