void setup() {
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
TCCR2A = (1 << WGM21) ;
TCCR2B = (1 << CS22 ) | (1 << CS21 );
OCR2A = 50;
TIMSK2 = 1 << OCIE2A;
}
ISR(TIMER2_COMPA_vect) {
static uint8_t tic;
tic=(tic&15)+1;
switch(tic){
case 1: PORTD&= ~((1<<PD3)|(1<<PD4));break;
case 8: PORTD= PORTD&0xe7|8; break;
default: if (tic>8){ PORTD^= (1<<PD3)|(1<<PD4);}
}
}
void loop() {}