【文件属性】:
文件名称:led显示按键中断次数
文件大小:667B
文件格式:C
更新时间:2022-12-15 14:17:51
c语言源程序
#include
#include
sbit K=P3^4;
sbit P2_2 = P2^2;
sbit P2_3 = P2^3;
unsigned char Counter;
unsigned char table[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,
0xf 8,0x80,0x90};
void delay (void)
{
unsigned char m,n,s;
for(m=20;m>0;m--)
for(n=20;n>0;n--)
for(s=200;s>0;s--);
}
void main(void)
{ IT0=1;
EA=1;
EX1=1;
Counter=0;
while(1);
}
void intl(void) interrupt 2
{
Counter++;
P0=~Counter;
EA=0;
P0=tabl