2023-12-22 11:26:26 | 32人围观 | 评论:
adcx1
=Get_Adc_Average(ADC_Channel_3,20);
LCD_ShowxNum(134,130,adcx1,4,16,0);
if(adcx1<4096/3.3*3.8/6.17)
LCD_ShowString(30,70,200,16,16,"voltage1isbad");
Else
LCD_ShowString(30,70,200,16,16,"voltage1isgood");
temp1
=(float)adcx1*(3.3/4096)*6.17;
adcx1e
=temp1;
LCD_ShowxNum(142,150,adcx1e,1,16,0);
temp1-
=adcx1e;
temp1*
=1000;
LCD_ShowxNum(158,150,temp1,3,16,0X80);
delay_ms(250);
adcx2
=Get_Adc_Average(ADC_Channel_4,20);
LCD_ShowxNum(142,170,adcx2,4,16,0);
if(adcx2<4096/3.3*7.6/6.17)
LCD_ShowString(30,90,200,16,16,"voltage2isbad");
Else
LCD_ShowString(30,110,200,16,16,"voltage3isgood");
temp3
=(float)adcx3*(3.3/4096)*6.11;adcx3e=temp3;
LCD_ShowxNum(134,230,adcx3e,2,16,0);
temp3-
=adcx3e;
temp3*
=1000;
LCD_ShowxNum(158,230,temp3,3,16,0X80);
delay_ms(250);
全站搜索