?? vpp.c
字號:
#include "stc12c5412ad.h"
#define uchar unsigned char
#define uint unsigned int
extern uchar keyfuncindex;
extern void d2(void);
extern void AD_init(uchar AD_port_sel );
extern uint GET_AD_Result();//啟動AD轉換并返回轉換值
extern void dis_cls(void);
extern void dis_one_char(uchar x,uchar y,uchar asc_num,bit b_flag);
extern void lcd_init(void);
extern void dis_one_zi();
extern void temp_to_tempx(uint temp);
extern void delay_1(uchar time);
extern uint temp0,temp1,temp2,temp3,temp4;
//sbit key1=P3^0;
//sbit key2=P3^1;
void get_value()
{
//
uint i;
uint max,min,value;
lcd_init();
AD_init(7);
while(1)
{
//max=512,min=512;
for(i=0;i<1000;i++)
{
value=GET_AD_Result();
if(value<min)
min=value;
if (value>max)
max=value;
}
min=(5000*min)/1023;
dis_cls();
temp_to_tempx(min);
dis_one_char(0,0,temp0+0x30,1);
dis_one_char(0,1,temp1+0x30,1);
dis_one_char(0,2,temp2+0x30,1);
dis_one_char(0,3,temp3+0x30,1);
dis_one_char(0,4,temp4+0x30,1);
max=(5000*max)/1023;
temp_to_tempx(max);
dis_one_char(2,0,temp0+0x30,1);
dis_one_char(2,1,temp1+0x30,1);
dis_one_char(2,2,temp2+0x30,1);
dis_one_char(2,3,temp3+0x30,1);
dis_one_char(2,4,temp4+0x30,1);
delay_1(20);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -