?? powervolt.c
字號:
show_value(temp); //n中數(shù)據(jù)處理與顯示
lcd_delay(50);
}
else
{
// V51=0;
lcd_pos(0x00); //設(shè)置顯示位置為第一行的第1個字符
i = 0;
while(dis47[i] != '\0') //顯示字符"Test Fail "
{
lcd_wdat(dis47[i]);
i++;
}
lcd_pos(0x40); //設(shè)置顯示位置為第二行第1個字符
i = 0;
while(dis17[i] != '\0')
{
lcd_wdat(dis17[i]); //顯示結(jié)果
i++;
}
show_value(temp); //n中數(shù)據(jù)處理與顯示
lcd_delay(50);
goto ERROR;
}
/**************************************************************************/
Port1C8255_write(64); //+12V關(guān)
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); //設(shè)置顯示位置為第一行的第1個字符
i = 0;
while(dis46[i] != '\0') //顯示字符"Test Pass"
{
lcd_wdat(dis46[i]);
i++;
}
lcd_pos(0x40); //設(shè)置顯示位置為第二行第1個字符
i = 0;
while(dis18[i] != '\0') //顯示結(jié)果
{
lcd_wdat(dis18[i]);
i++;
}
show_value(temp); //n中數(shù)據(jù)處理與顯示
lcd_delay(50);
}
else
{
// V51=0;
lcd_pos(0x00); //設(shè)置顯示位置為第一行的第1個字符
i = 0;
while(dis47[i] != '\0') //顯示字符"Test Fail "
{
lcd_wdat(dis47[i]);
i++;
}
lcd_pos(0x40); //設(shè)置顯示位置為第二行第1個字符
i = 0;
while(dis18[i] != '\0')
{
lcd_wdat(dis18[i]); //顯示結(jié)果
i++;
}
show_value(temp); //n中數(shù)據(jù)處理與顯示
lcd_delay(50);
goto ERROR;
}
/**************************************************************************/
Port1C8255_write(64); //+18V關(guān)
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); //設(shè)置顯示位置為第一行的第1個字符
i = 0;
while(dis46[i] != '\0') //顯示字符"Test Pass"
{
lcd_wdat(dis46[i]);
i++;
}
lcd_pos(0x40); //設(shè)置顯示位置為第二行第1個字符
i = 0;
while(dis19[i] != '\0') //顯示結(jié)果
{
lcd_wdat(dis19[i]);
i++;
}
show_value(temp); //n中數(shù)據(jù)處理與顯示
lcd_delay(50);
}
else
{
// V51=0;
lcd_pos(0x00); //設(shè)置顯示位置為第一行的第1個字符
i = 0;
while(dis47[i] != '\0') //顯示字符"Test Fail "
{
lcd_wdat(dis47[i]);
i++;
}
lcd_pos(0x40); //設(shè)置顯示位置為第二行第1個字符
i = 0;
while(dis19[i] != '\0')
{
lcd_wdat(dis19[i]); //顯示結(jié)果
i++;
}
show_value(temp); //n中數(shù)據(jù)處理與顯示
lcd_delay(50);
goto ERROR;
}
/**************************************************************************/
Port1C8255_write(64); //-18V關(guān)
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); //設(shè)置顯示位置為第一行的第1個字符
i = 0;
while(dis46[i] != '\0') //顯示字符"Test Pass"
{
lcd_wdat(dis46[i]);
i++;
}
lcd_pos(0x40); //設(shè)置顯示位置為第二行第1個字符
i = 0;
while(dis20[i] != '\0') //顯示結(jié)果
{
lcd_wdat(dis20[i]);
i++;
}
show_value(temp); //n中數(shù)據(jù)處理與顯示
lcd_delay(50);
}
else
{
// V51=0;
lcd_pos(0x00); //設(shè)置顯示位置為第一行的第1個字符
i = 0;
while(dis47[i] != '\0') //顯示字符"Test Fail "
{
lcd_wdat(dis47[i]);
i++;
}
lcd_pos(0x40); //設(shè)置顯示位置為第二行第1個字符
i = 0;
while(dis20[i] != '\0')
{
lcd_wdat(dis20[i]); //顯示結(jié)果
i++;
}
show_value(temp); //n中數(shù)據(jù)處理與顯示
lcd_delay(50);
goto ERROR;
}
/**************************************************************************/
Port1C8255_write(64); //+24Va關(guān)
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); //設(shè)置顯示位置為第一行的第1個字符
i = 0;
while(dis46[i] != '\0') //顯示字符"Test Pass"
{
lcd_wdat(dis46[i]);
i++;
}
lcd_pos(0x40); //設(shè)置顯示位置為第二行第1個字符
i = 0;
while(dis21[i] != '\0') //顯示結(jié)果
{
lcd_wdat(dis21[i]);
i++;
}
show_value(temp); //n中數(shù)據(jù)處理與顯示
lcd_delay(50);
}
else
{
// V51=0;
lcd_pos(0x00); //設(shè)置顯示位置為第一行的第1個字符
i = 0;
while(dis47[i] != '\0') //顯示字符"Test Fail "
{
lcd_wdat(dis47[i]);
i++;
}
lcd_pos(0x40); //設(shè)置顯示位置為第二行第1個字符
i = 0;
while(dis21[i] != '\0')
{
lcd_wdat(dis21[i]); //顯示結(jié)果
i++;
}
show_value(temp); //n中數(shù)據(jù)處理與顯示
lcd_delay(50);
goto ERROR;
}
/**************************************************************************/
Port1C8255_write(64); //+24Vb關(guān)
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); //設(shè)置顯示位置為第一行的第1個字符
i = 0;
while(dis46[i] != '\0') //顯示字符"Test Pass"
{
lcd_wdat(dis46[i]);
i++;
}
lcd_pos(0x40); //設(shè)置顯示位置為第二行第1個字符
i = 0;
while(dis22[i] != '\0') //顯示結(jié)果
{
lcd_wdat(dis22[i]);
i++;
}
show_value(temp); //n中數(shù)據(jù)處理與顯示
lcd_delay(50);
}
else
{
// V51=0;
lcd_pos(0x00); //設(shè)置顯示位置為第一行的第1個字符
i = 0;
while(dis47[i] != '\0') //顯示字符"Test Fail "
{
lcd_wdat(dis47[i]);
i++;
}
lcd_pos(0x40); //設(shè)置顯示位置為第二行第1個字符
i = 0;
while(dis22[i] != '\0')
{
lcd_wdat(dis22[i]); //顯示結(jié)果
i++;
}
show_value(temp); //n中數(shù)據(jù)處理與顯示
lcd_delay(50);
goto ERROR;
}
/****************************************************************************/
/* */
/* 第四組:120V輸入K1,MAX LOAD 負(fù)載開K6,狀態(tài)開關(guān)ON / K15 /64 */
/****************************************************************************/
Port1A8255_write(1); //110V電源開
Port1C8255_write(64); //狀態(tài)開關(guān)ON
Timer100ms=10;
while(Timer100ms);
Port1A8255_write(161); //110V電源開,負(fù)載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); //設(shè)置顯示位置為第一行的第1個字符
i = 0;
while(dis46[i] != '\0') //顯示字符"Test Pass"
{
lcd_wdat(dis46[i]);
i++;
}
lcd_pos(0x40); //設(shè)置顯示位置為第二行第1個字符
i = 0;
while(dis23[i] != '\0') //顯示結(jié)果
{
lcd_wdat(dis23[i]);
i++;
}
show_value(temp); //n中數(shù)據(jù)處理與顯示
lcd_delay(50);
}
else
{
// V51=0;
lcd_pos(0x00); //設(shè)置顯示位置為第一行的第1個字符
i = 0;
while(dis47[i] != '\0') //顯示字符"Test Fail "
{
lcd_wdat(dis47[i]);
i++;
}
lcd_pos(0x40); //設(shè)置顯示位置為第二行第1個字符
i = 0;
while(dis23[i] != '\0')
{
lcd_wdat(dis23[i]); //顯示結(jié)果
i++;
}
show_value(temp); //n中數(shù)據(jù)處理與顯示
lcd_delay(50);
goto ERROR;
}
/**************************************************************************/
Port1A8255_write(33); //+5V 關(guān)
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); //設(shè)置顯示位置為第一行的第1個字符
i = 0;
while(dis46[i] != '\0') //顯示字符"Test Pass"
{
lcd_wdat(dis46[i]);
i++;
}
lcd_pos(0x40); //設(shè)置顯示位置為第二行第1個字符
i = 0;
while(dis24[i] != '\0') //顯示結(jié)果
{
lcd_wdat(dis24[i]);
i++;
}
show_value(temp); //n中數(shù)據(jù)處理與顯示
lcd_delay(50);
}
else
{
// V51=0;
lcd_pos(0x00); //設(shè)置顯示位置為第一行的第1個字符
i = 0;
while(dis47[i] != '\0') //顯示字符"Test Fail "
{
lcd_wdat(dis47[i]);
i++;
}
lcd_pos(0x40); //設(shè)置顯示位置為第二行第1個字符
i = 0;
while(dis24[i] != '\0')
{
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -