ud23
Advanced Member level 3
ok i tried condition for switch as you suggested i try make PA3 pin toggle when interrupt 1 occurs
even PIN 3 of PORT A is not toggling when switch is zero.
Code:
ISR(TIMER1_OVF_vect) {
if(!CHECKBIT(PINC,1))
{
// PINC1 state is 0 this condition for switch pressed at PinC1
PORTB=(1<<PB0)|(0<<PB1)|(0<<PB2)|(0<<PB3)|(0<<PB4);
SEVEN_SEGMENT_PORT=0xc6;
PORTA=(1<<PA3);
_delay_us(100);
PORTA=(0<<PA3);
}
else
if(!CHECKBIT(PINC,2))
{
// PINC2 state is 0 this condition is for switch pressed at PINC2
PORTB=(1<<PB0)|(0<<PB1)|(0<<PB2)|(0<<PB3)|(0<<PB4);
SEVEN_SEGMENT_PORT=values[11];
}
}
even PIN 3 of PORT A is not toggling when switch is zero.