#include #include char count = 0x20; int main (void) { DDRC = 0x00; // all input PORTC = 0xFF; // enable pull-up for all pins DDRB = 0xFF; // all output, use LED at B5 PCMSK1 = 0x10; // interrupt line C4 (PCINT12) PCIFR = 0x02; // clear any pending interrupt PCICR = 0x02; // enable interrupt for pin-change-1 sei(); // global interrupt enable while(1) PORTB = count; // endless loop – display counter } ISR(PCINT1_vect) { count = ~count; // toggle all pins: pin5 = LED PCIFR = 0x02; // Delete pin change interrupt flags }