#include<reg51.h>
#define LEDs P0
unsigned char count=0;
void ext_int_0 () interrupt 0
{
count++;
}
void ext_int_1 () interrupt 2
{
count--;
}
void main()
{
P3 |= 0x0c; // Configure the INT0 & INT1 pins as Inputs
EX0 = 1; // Enable INT0
EX1 = 1; // Enable INT1
EA = 1; // Enable Global Interrupt bit
while(1)
{
LEDs = count;
}
}
'공학속으로 > 마이컴' 카테고리의 다른 글
PIC18F4520 Timer. (0) | 2020.03.04 |
---|---|
8051 모든 인터럽트 (0) | 2020.03.04 |
8051/4051 Timers (0) | 2020.03.04 |
8051/4051 UART Interrupt (0) | 2020.03.03 |
8051/4051 UART (0) | 2020.03.03 |
댓글