📄 powervolt.c
字号:
show_value(temp); //n中数据处理与显示
lcd_delay(50);
}
else
{
// V51=0;
lcd_pos(0x00); //设置显示位置为第一行的第1个字符
i = 0;
while(dis47[i] != '\0') //显示字符"Test Fail "
{
lcd_wdat(dis47[i]);
i++;
}
lcd_pos(0x40); //设置显示位置为第二行第1个字符
i = 0;
while(dis17[i] != '\0')
{
lcd_wdat(dis17[i]); //显示结果
i++;
}
show_value(temp); //n中数据处理与显示
lcd_delay(50);
goto ERROR;
}
/**************************************************************************/
Port1C8255_write(64); //+12V关
Timer100ms=2;
while(Timer100ms);
Port1C8255_write(66); //+18V开
Timer100ms=5;
while(Timer100ms);
write_ads(0x8c);
read_ads();
temp1=adc_hi;
temp1=temp1<<8;
temp1+=adc_lo;
temp=(float)temp1/32768*2.048;
temp*=1.15;
temp*=1000;
if ((temp>=Limit[4])&&(temp<=Limit[5]))
{
// V51=1;
lcd_pos(0x00); //设置显示位置为第一行的第1个字符
i = 0;
while(dis46[i] != '\0') //显示字符"Test Pass"
{
lcd_wdat(dis46[i]);
i++;
}
lcd_pos(0x40); //设置显示位置为第二行第1个字符
i = 0;
while(dis18[i] != '\0') //显示结果
{
lcd_wdat(dis18[i]);
i++;
}
show_value(temp); //n中数据处理与显示
lcd_delay(50);
}
else
{
// V51=0;
lcd_pos(0x00); //设置显示位置为第一行的第1个字符
i = 0;
while(dis47[i] != '\0') //显示字符"Test Fail "
{
lcd_wdat(dis47[i]);
i++;
}
lcd_pos(0x40); //设置显示位置为第二行第1个字符
i = 0;
while(dis18[i] != '\0')
{
lcd_wdat(dis18[i]); //显示结果
i++;
}
show_value(temp); //n中数据处理与显示
lcd_delay(50);
goto ERROR;
}
/**************************************************************************/
Port1C8255_write(64); //+18V关
Timer100ms=2;
while(Timer100ms);
Port1C8255_write(68); //-18V开
Timer100ms=5;
while(Timer100ms);
write_ads(0x8c);
read_ads();
temp1=adc_hi;
temp1=temp1<<8;
temp1+=adc_lo;
temp=(float)temp1/32768*2.048;
temp*=1.11;
temp*=1000;
if ((temp>=Limit[6])&&(temp<=Limit[7]))
{
// V51=1;
lcd_pos(0x00); //设置显示位置为第一行的第1个字符
i = 0;
while(dis46[i] != '\0') //显示字符"Test Pass"
{
lcd_wdat(dis46[i]);
i++;
}
lcd_pos(0x40); //设置显示位置为第二行第1个字符
i = 0;
while(dis19[i] != '\0') //显示结果
{
lcd_wdat(dis19[i]);
i++;
}
show_value(temp); //n中数据处理与显示
lcd_delay(50);
}
else
{
// V51=0;
lcd_pos(0x00); //设置显示位置为第一行的第1个字符
i = 0;
while(dis47[i] != '\0') //显示字符"Test Fail "
{
lcd_wdat(dis47[i]);
i++;
}
lcd_pos(0x40); //设置显示位置为第二行第1个字符
i = 0;
while(dis19[i] != '\0')
{
lcd_wdat(dis19[i]); //显示结果
i++;
}
show_value(temp); //n中数据处理与显示
lcd_delay(50);
goto ERROR;
}
/**************************************************************************/
Port1C8255_write(64); //-18V关
Timer100ms=2;
while(Timer100ms);
Port1C8255_write(72); //+24Va开
Timer100ms=5;
while(Timer100ms);
write_ads(0x8c);
read_ads();
temp1=adc_hi;
temp1=temp1<<8;
temp1+=adc_lo;
temp=(float)temp1/32768*2.048;
temp*=2.015;
temp*=1000;
if ((temp>=Limit[8])&&(temp<=Limit[9]))
{
// V51=1;
lcd_pos(0x00); //设置显示位置为第一行的第1个字符
i = 0;
while(dis46[i] != '\0') //显示字符"Test Pass"
{
lcd_wdat(dis46[i]);
i++;
}
lcd_pos(0x40); //设置显示位置为第二行第1个字符
i = 0;
while(dis20[i] != '\0') //显示结果
{
lcd_wdat(dis20[i]);
i++;
}
show_value(temp); //n中数据处理与显示
lcd_delay(50);
}
else
{
// V51=0;
lcd_pos(0x00); //设置显示位置为第一行的第1个字符
i = 0;
while(dis47[i] != '\0') //显示字符"Test Fail "
{
lcd_wdat(dis47[i]);
i++;
}
lcd_pos(0x40); //设置显示位置为第二行第1个字符
i = 0;
while(dis20[i] != '\0')
{
lcd_wdat(dis20[i]); //显示结果
i++;
}
show_value(temp); //n中数据处理与显示
lcd_delay(50);
goto ERROR;
}
/**************************************************************************/
Port1C8255_write(64); //+24Va关
Timer100ms=2;
while(Timer100ms);
Port1C8255_write(80); //+24Vb开
Timer100ms=5;
while(Timer100ms);
write_ads(0x8c);
read_ads();
temp1=adc_hi;
temp1=temp1<<8;
temp1+=adc_lo;
temp=(float)temp1/32768*2.048;
temp*=2.015;
temp*=1000;
if ((temp>=Limit[10])&&(temp<=Limit[11]))
{
// V51=1;
lcd_pos(0x00); //设置显示位置为第一行的第1个字符
i = 0;
while(dis46[i] != '\0') //显示字符"Test Pass"
{
lcd_wdat(dis46[i]);
i++;
}
lcd_pos(0x40); //设置显示位置为第二行第1个字符
i = 0;
while(dis21[i] != '\0') //显示结果
{
lcd_wdat(dis21[i]);
i++;
}
show_value(temp); //n中数据处理与显示
lcd_delay(50);
}
else
{
// V51=0;
lcd_pos(0x00); //设置显示位置为第一行的第1个字符
i = 0;
while(dis47[i] != '\0') //显示字符"Test Fail "
{
lcd_wdat(dis47[i]);
i++;
}
lcd_pos(0x40); //设置显示位置为第二行第1个字符
i = 0;
while(dis21[i] != '\0')
{
lcd_wdat(dis21[i]); //显示结果
i++;
}
show_value(temp); //n中数据处理与显示
lcd_delay(50);
goto ERROR;
}
/**************************************************************************/
Port1C8255_write(64); //+24Vb关
Timer100ms=2;
while(Timer100ms);
Port1C8255_write(96); //+Vbr开
Timer100ms=5;
while(Timer100ms);
write_ads(0x8c);
read_ads();
temp1=adc_hi;
temp1=temp1<<8;
temp1+=adc_lo;
temp=(float)temp1/32768*2.048;
temp*=1.17;
temp*=1000;
if ((temp>=Limit[12])&&(temp<=Limit[13]))
{
// V51=1;
lcd_pos(0x00); //设置显示位置为第一行的第1个字符
i = 0;
while(dis46[i] != '\0') //显示字符"Test Pass"
{
lcd_wdat(dis46[i]);
i++;
}
lcd_pos(0x40); //设置显示位置为第二行第1个字符
i = 0;
while(dis22[i] != '\0') //显示结果
{
lcd_wdat(dis22[i]);
i++;
}
show_value(temp); //n中数据处理与显示
lcd_delay(50);
}
else
{
// V51=0;
lcd_pos(0x00); //设置显示位置为第一行的第1个字符
i = 0;
while(dis47[i] != '\0') //显示字符"Test Fail "
{
lcd_wdat(dis47[i]);
i++;
}
lcd_pos(0x40); //设置显示位置为第二行第1个字符
i = 0;
while(dis22[i] != '\0')
{
lcd_wdat(dis22[i]); //显示结果
i++;
}
show_value(temp); //n中数据处理与显示
lcd_delay(50);
goto ERROR;
}
/****************************************************************************/
/* */
/* 第四组:120V输入K1,MAX LOAD 负载开K6,状态开关ON / K15 /64 */
/****************************************************************************/
Port1A8255_write(1); //110V电源开
Port1C8255_write(64); //状态开关ON
Timer100ms=10;
while(Timer100ms);
Port1A8255_write(161); //110V电源开,负载LL110开,+5V开
Timer100ms=10;
while(Timer100ms);
write_ads(0x8c);
read_ads();
temp1=adc_hi;
temp1=temp1<<8;
temp1+=adc_lo;
temp=(float)temp1/32768*2.048;
temp*=1.022;
temp*=1000;
if ((temp>=Limit[0])&&(temp<=Limit[1]))
{
// V51=1;
lcd_pos(0x00); //设置显示位置为第一行的第1个字符
i = 0;
while(dis46[i] != '\0') //显示字符"Test Pass"
{
lcd_wdat(dis46[i]);
i++;
}
lcd_pos(0x40); //设置显示位置为第二行第1个字符
i = 0;
while(dis23[i] != '\0') //显示结果
{
lcd_wdat(dis23[i]);
i++;
}
show_value(temp); //n中数据处理与显示
lcd_delay(50);
}
else
{
// V51=0;
lcd_pos(0x00); //设置显示位置为第一行的第1个字符
i = 0;
while(dis47[i] != '\0') //显示字符"Test Fail "
{
lcd_wdat(dis47[i]);
i++;
}
lcd_pos(0x40); //设置显示位置为第二行第1个字符
i = 0;
while(dis23[i] != '\0')
{
lcd_wdat(dis23[i]); //显示结果
i++;
}
show_value(temp); //n中数据处理与显示
lcd_delay(50);
goto ERROR;
}
/**************************************************************************/
Port1A8255_write(33); //+5V 关
Timer100ms=2;
while(Timer100ms);
Port1C8255_write(65); //+12V开
Timer100ms=5;
while(Timer100ms);
write_ads(0x8c);
read_ads();
temp1=adc_hi;
temp1=temp1<<8;
temp1+=adc_lo;
temp=(float)temp1/32768*2.048;
temp*=1.030;
temp*=1000;
if ((temp>=Limit[2])&&(temp<=Limit[3]))
{
// V51=1;
lcd_pos(0x00); //设置显示位置为第一行的第1个字符
i = 0;
while(dis46[i] != '\0') //显示字符"Test Pass"
{
lcd_wdat(dis46[i]);
i++;
}
lcd_pos(0x40); //设置显示位置为第二行第1个字符
i = 0;
while(dis24[i] != '\0') //显示结果
{
lcd_wdat(dis24[i]);
i++;
}
show_value(temp); //n中数据处理与显示
lcd_delay(50);
}
else
{
// V51=0;
lcd_pos(0x00); //设置显示位置为第一行的第1个字符
i = 0;
while(dis47[i] != '\0') //显示字符"Test Fail "
{
lcd_wdat(dis47[i]);
i++;
}
lcd_pos(0x40); //设置显示位置为第二行第1个字符
i = 0;
while(dis24[i] != '\0')
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -