云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > ADC0832数字电压表

ADC0832数字电压表

  • 62 次阅读
  • 3 次下载
  • 2025/7/8 8:56:55

附录四:电压表源程序: #include #include

#define uchar unsigned char #define uint unsigned int

#include%uchar code table[]= {

0xc0,0xf9,0xa4,0xb0,0x99, 0x92,0x82,0xf8,0x80,0x90,

}; //共阳数码管段码表 没有小数点 0~9

- 21 -

uchar code table1[]= {0x40,0x79,0x24,0x30,0x19,

0x12,0x02,0x78,0x00,0x10};//带小数点的编码 0~9

uchar dat=0;//AD值 uint c,d;

uint DY_dat=0; //烟雾浓度数据 uchar ad_dat1=0; //读取滤波后的AD值 uchar count=0;//定时器计数 uchar CH=0;//通道变量

uint num,ge,xiao1,xiao2,shi,shi1,ge1,xiao3,xiao4,dy;

/**********************************************************/

/********************************************************* 延时函数

**********************************************************/ void delay(uint x) { uint a,b;

- 22 -

for(a=x;a>0;a--) for(b=110;b>0;b--); }

void Read_ad() {

static uint AD_DAT=0; float ad_buf=0; static uchar i=0; if(i<5) // 滤 { i++;

AD_DAT+=A_D(); // 波 }

else // 算 {

i=0; // 法 ad_dat1=(uchar)(AD_DAT/5);

- 23 -

ad_buf=(float)(ad_dat1/0.51); DY_dat=(uint)(ad_buf); AD_DAT=0; } }

/******************************************************** 显示函数

********************************************************/

void display() {

shi1=DY_dat/1000; ge1=DY_dat00/100; xiao2=DY_dat0/10; xiao3=DY_dat;

- 24 -

搜索更多关于: ADC0832数字电压表 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

附录四:电压表源程序: #include #include #define uchar unsigned char #define uint unsigned int #include%uchar code table[]= { 0xc0,0xf9,0xa4,0xb0,0x99, 0x92,0x82,0xf8,0x80,0x90, }; //共阳数码管段码表 没有小数点 0~9 - 21 - uchar code table1[]= {0x40,0x79,0x24,0x30,0x19, 0x12,0x02,0x78,0x00,0x10};//带小数点的编码 0~9

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com