数显模数转换.doc

上传人:cl****1 文档编号:549493037 上传时间:2023-09-25 格式:DOC 页数:3 大小:27KB
返回 下载 相关 举报
数显模数转换.doc_第1页
第1页 / 共3页
数显模数转换.doc_第2页
第2页 / 共3页
数显模数转换.doc_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

《数显模数转换.doc》由会员分享,可在线阅读,更多相关《数显模数转换.doc(3页珍藏版)》请在金锄头文库上搜索。

1、#include#define uint unsigned intvoid delay(uint); unsigned char code dispcode=0xc0,0xcf,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x98;unsigned char code dispbitcode=0x10,0x20,0x40,0x80; extern unsigned char dispbuf6=0,0,0,0,0,0; unsigned char dispcount=0;unsigned int getdata;unsigned int temp,i;/unsigned

2、 char ;sbit ST=P30;sbit OE=P31;sbit EOC=P32;sbit CLK=P33;void main(void)ST=1;OE=1;TR0=0;TR1=0;TMOD=0x12;TH0=116;TL0=116;TH1=(65536-400)/256;TL1=(65536-400)%256;EA=1;ET0=1;ET1=1;TR1=1;TR0=1;ST=0;ST=1;while(1)if(EOC=1)OE=0;OE=1;temp=(uint)(5.00*getdata/256*100);/if(temp=0)temp*10;i=3;while(temp)dispbu

3、fi=temp%10;i-;temp=temp/10;dispbufi=temp;ST=0;delay(10);getdata=P0;ST=1;void t0(void) interrupt 1 CLK=CLK;void t1(void) interrupt 3 TH1=(65536-400)/256;TL1=(65536-400)%256;P1=dispcodedispbufdispcount|dispbitcodedispcount;/P2=;/if(dispcount=1)/P1=P1&0x7f;/dispcount+;if(dispcount=3)dispcount=0;if(P0=0x00)P1=0xc0; void delay(uint x) int i,j;for(i=0;ix;i+)for(j=1;j1000;j+);

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 生活休闲 > 社会民生

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号