/*************三个端口都为低电平电机旋转****/
void Read_Intput(uint times)
{
vala=0;
do
{
times--;
RstKey();
for(;kcounter<10;) //按键循环10
{
zstatus++; //报警计数器
if(IntPut4&&!IntPut22&&!IntPut23)//过桥退 机座退 润滑退
{
LowVoltKey(); //按键低电平 计数器加一状态标志加一
}
else if(~!IntPut4||~!IntPut22||~!IntPut23) //按键高电平
{
HighVoltKey(); //按键计数器加一 状态计数器归零
}
}
if(kstatus>=8) /*按键状态标志大于等于8为有效值*/
{
OutPut1=0; //电机开
OutPut17=0; //电机开
Signauto=1; /*行程输入信号检测标志无输入为1,永久循环*/
do /*行程输入信号检测标志无输入为1,永久循环*/
{
vala++; //检测外部中断0超时报警退出循环
if(vala>=val12)
{
Motor_Warning();
Signauto=0; //超时退出循环
}
}
while(Signauto); //外部中断0检测到输入信号 退出循环
}
delay10ms(100); //
}
while(times);
}
void Read_Intput(uint times)
{
vala=0;
do
{
times--;
RstKey();
for(;kcounter<10;) //按键循环10
{
zstatus++; //报警计数器
if(IntPut4&&!IntPut22&&!IntPut23)//过桥退 机座退 润滑退
{
LowVoltKey(); //按键低电平 计数器加一状态标志加一
}
else if(~!IntPut4||~!IntPut22||~!IntPut23) //按键高电平
{
HighVoltKey(); //按键计数器加一 状态计数器归零
}
}
if(kstatus>=8) /*按键状态标志大于等于8为有效值*/
{
OutPut1=0; //电机开
OutPut17=0; //电机开
Signauto=1; /*行程输入信号检测标志无输入为1,永久循环*/
do /*行程输入信号检测标志无输入为1,永久循环*/
{
vala++; //检测外部中断0超时报警退出循环
if(vala>=val12)
{
Motor_Warning();
Signauto=0; //超时退出循环
}
}
while(Signauto); //外部中断0检测到输入信号 退出循环
}
delay10ms(100); //
}
while(times);
}