533
// ISR Handler void __interrupt() ISR() { if (CCP1IF) { // Capture event occurred, read CCPR1 value uint16_t capturedValue = CCPR1L | (CCPR1H << 8); if (capturedValue == 9) { // Toggle the LED (now on RC3) RC3 = ~RC3; } // Write CCPR1 value to PORTB PORTB = capturedValue; // Clear the Interrupt Flag Bit CCP1IF = 0; } }