任务:读取外部0~5V的电压变化,将之输出到LCD显示 1。建立如下原理图 2.生成代码 //*************************************************** //main.c //latest revise:2010-009-20 //by:alex shoal //email:alex.shoal@gmail.com #include<reg51.h> #include <stdio.h> #include"global.h" #include "ADC0808.h" #include "ks0066.h" // for lcd 1602 main(){ //float res=0; int res=0; float vol=0.0; char pr[8]; lcd_init(); while(1) { res=read_data(); vol=5.0*res/255; sprintf(pr,"%.2f",vol); //sprintf(pr,"%d",res); //LCD_clear(); LCD_home(); print_string("Read:"); print_string(pr); print_string("V ");} } //******************************************************** //ADC0808.H //#include"global.h" sbit START=