背景:判断油量(Oil)变化是否在合理范围,超过范围油量变化(dOil)为1,否则为0.
unsigned char Oil_Change()
{
unsigned int a;
Oil = Read_AD_Data(0xE4);//读取ad转化的数字量
a = Oil;
delay(50);
if(Oil == a )
{
dOil=0;
}
else
{
dOil=1;
}
return dOil;
}
背景:判断油量(Oil)变化是否在合理范围,超过范围油量变化(dOil)为1,否则为0.
unsigned char Oil_Change()
{
unsigned int a;
Oil = Read_AD_Data(0xE4);//读取ad转化的数字量
a = Oil;
delay(50);
if(Oil == a )
{
dOil=0;
}
else
{
dOil=1;
}
return dOil;
}