AD_Value = GetADCResult(0);
TI=1;
printf("the AD_Value is %f\r\n",AD_Value);
  WM_VAL += (int)(IncPIDCalc(AD_Value)*200);
if(PWM_VAL<=600)
{
flag=1;
  WM_VAL=500;
}
else if((PWM_VAL<1400)&&(PWM_VAL>600))
{
flag=0;
JB=1;
  WM_VAL += (int)(IncPIDCalc(AD_Value)*200);
}
else if(PWM_VAL>=1400)
{
flag=1;
  WM_VAL=1500;
}
void T1() interrupt 3
{
TH1=0xfc;
TL1=0x6b;
if(flag==1)
{
j++;
if(j==1000)
{
j=0;
n++;
if(n==60)
{
n=0;
if((PWM_VAL>=1500)||(PWM_VAL<=500))
JB=0;
}
}
}
}
求大神门给看看 JB是警报的意思 我的这个怎么不能报警 |