int main(){
DDRD |= (1<<5)|(1<<6)|(1<<7);
DDRB &= ~((1<<0)|(1<<1)|(1<<2));
PCICR |= (1<<0);//Pin change interrupt control register:(pin 7....0):
PCMSK0 |= (1<<0)|(1<<1)|(1<<2);//Pin Change Mask Register:
sei();
while(1){
//
}
}
ISR(PCINT0_vect){
if(PINB & (1<<0)){
PORTD &= ~(1<<6);
PORTD &= ~(1<<5);
PORTD ^= (1<<7);
}else if(PINB & (1<<1)){
PORTD &= ~(1<<7);
PORTD &= ~(1<<5);
PORTD |= (1<<6);
}else if(PINB & (1<<2)){
PORTD &= ~(1<<7);
PORTD &= ~(1<<6);
PORTD |= (1<<5);
}
}