/* 외부인터럽트와 PWM제어 */


#include <avr/io.h>
#include <avr/interrupt.h>

int digit[10] ={0x18, 0xBB, 0x2C, 0x29, 0x8B, 0x49, 0x48, 0x3B, 0x08, 0x09};

SIGNAL(SIG_INTERRUPT7)
{
 OCR0 += 5;
}

int main(void)
{
 DDRA = 0xFF;
 DDRB = 1<<PB4;
 
 EIMSK = 1<<INT7;
 DDRE = DDRE & ~(1<<INT7);
 EICRB = 0x80;
 
 TCCR0 = 0x67;
 
 sei();
 
 while(1){
  PORTA = digit[OCR0/26];
 }

 return 0;
}

 
