各位大佬,我这个程序怎么不能下降沿触发,求大佬帮我改成下降沿触发,感激不尽
#include
#define uchar unsigned char
#define uint unsigned int
char count1=40,count2=40;
sbit IN_1=P3^4;
sbit IN_2=P3^5;
sbit OUT_1=P3^3;
sbit OUT_2=P3^2;
void main()
{
TMOD = 0x01; //设置定时器模式
TL0 = 0xaf; //设置定时初值
TH0 = 0x3c; //设置定时初值
TF0 = 0; //清除TF0标志
TR0 = 1; //定时器0开始计时
EA = 1;
ET0 = 1;
OUT_1=1;
IN_1=1;
while(1)
{
if((IN_1==0) && (OUT_1==1))
OUT_1=0;
if(count1==0)
{
OUT_1=1;
IN_1=1;
count1=40;
}
}
}
void Time0() interrupt 1
{
TL0 = 0xaf; //定时器手动重装载
TH0 = 0x3c;
if(OUT_1==0)
{
count1--;
}
}
EA = 1; //开总中断
EX0 = 1; //开外部中断0
IT0 = 1; //选择电平负跳变触发方式,