PIC16F917 电压表
LCD_CE=1 ;// 关闭LCD
}
////////////主程序/////////////////////////
void main (void)
{
Init();//初始化程序
LCD_clear(); //LCD清屏
delayms(1000);
LCD_write_english_string(0,0," AD Test " );
LCD_write_english_string(0,1,"AD4 Vref=3.3V" );
ADCON0=ADCON0|0B00000010;//开始AD转换
LCD_set_XY(0,3);
LCD_write_char(D);
LCD_write_char(x);
LCD_write_char( );
LCD_write_char(=);
LCD_set_XY(0,5);
LCD_write_char(V);
LCD_write_char(i);
LCD_write_char(n);
LCD_write_char(=);
LCD_set_XY(72,5);
LCD_write_char(V);
while(1)
{
LCD_set_XY(30,3);
LCD_write_char((temp3/1000)+16+32);
LCD_write_char( (temp3%1000)/100+16+32);
LCD_write_char( ((temp3%1000)%100)/10+16+32);
LCD_write_char( ((temp3%1000)%100)%10+16+32);
//ad_data=ad_data*10000;
temp3=(uint)ad_data;
LCD_set_XY(30,5);
LCD_write_char((temp3/10000)+16+32);
LCD_write_char(.);
LCD_write_char( (temp3%10000)/1000+16+32);
LCD_write_char( ((temp3%10000)%1000)/100+16+32);
LCD_write_char( (((temp3%10000)%1000)%100)/10+16+32);
LCD_write_char( (((temp3%10000)%1000)%100)%10+16+32);
delayms(100);
ADCON0=ADCON0|0B00000010;//开始AD转换
}
}
PIC16F917电压 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)