sbit D1=P1^5; //3.3V pass LED
sbit D2=P1^6; //3.3V fail LED
sbit D3=P1^7; //5V pass LED
sbit D4=P2^6; //5V fail LED
sbit D5=P2^5; //12V pass LED
sbit D6=P2^4; //12V fail LED
sbit bee=P3^4; //蜂鸣器
void panduan() //判断电压范围
{
ulong x1,x2,x3;
ulong y1,y2,y3;
if((y1<min33)||(y1>max33))
{
D1=1;
D2=0;
bee=0;
}
else
{
D1=0;
D2=1;
bee=1;
}
if((x1<min12)||(x1>max12))
// if((x1<min33)||(x1>max33))
{
lcd_pos(4,0);
lcd_wdat('P');
D1=1;
D2=0;
bee=0;
}
else
{
lcd_pos(4,0);
lcd_wdat('Q');
D1=0;
D2=1;
bee=1;
}
if((y2<min5)||(y2>max5))
{
D3=1;
D4=0;
bee=0;
}
else
{
D3=0;
D4=1;
bee=1;
}
if((x2<min5)||(x2>max5))
{
D3=1;
D4=0;
bee=0;
}
else
{
D3=0;
D4=1;
bee=1;
}
if((y3<min12)||(y3>max12))
{
D5=1;
D6=0;
bee=0;
}
else
{
D5=0;
D6=1;
bee=1;
}
if((x3<min12)||(x3>max12))
{
D5=1;
D6=0;
bee=0;
}
else
{
D5=0;
D6=1;
bee=1;
}
}
蜂鸣器一直叫,怎么解决,各位大侠
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
先检查驱动方式是否正确,
再将单个if....else....插入测试,
知道正常, 再一个个插入
一周热门 更多>