单片机数码管显示温度程序(共6页).doc





《单片机数码管显示温度程序(共6页).doc》由会员分享,可在线阅读,更多相关《单片机数码管显示温度程序(共6页).doc(6页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精选优质文档-倾情为你奉上/项目:数码管温度显示器/编写:LGY/功能:数码管显示温度#includereg52.h#includeintrins.h#define uchar unsigned char#define uint unsigned int/*位定义*/sbit RX =P30;sbit TX =P31;sbit RX_TX_con =P32;/sbit Fre_check =P35;sbit DQ =P35;sbit SDA =P36;sbit SCL =P37;sbit LED_1 =P02;sbit LED_2 =P00;sbit LED_3 =P01;sbit LED_4
2、 =P03;unsigned char a1,a2,a3,a4;unsigned int temper;unsigned char code displaycode= / 0 1 2 3 4 5 6 7 8 9 0x28, 0xee, 0x32, 0xa2, 0xe4, 0xa1, 0x21, 0xea, 0x20, 0xa0, ;unsigned char code displaycode1= / 0. 1. 2. 3. 4. 5. 6. 7. 8. 9. 0x08, 0xce, 0x12, 0x82, 0xc4, 0x81, 0x01, 0xca, 0x00, 0x80, ;void IN
3、T() P0=0xff; P1=0xff; P2=0; P3=0; DQ=1; / Fre_check=1; void Delay(uint x) uint a,b; for(a=x;a0;a-) for(b=110;b0;b-);/*void Delay1(uint x,uchar y)uint i;uchar j;for(i=x;i0;i-);for(j=y;j0;j-);void reset()unsigned char st=1;Fre_check=1;/_nop_();/_nop_();while(st)Fre_check=0;Delay1(70,30);Fre_check=1;De
4、lay1(4,4);if(Fre_check=1) st=1;else st=0;Delay1(50,10);void write_byte(unsigned char date)unsigned char temp,i;Fre_check=1;/_nop_();/_nop_();for(i=8;i0;i-) temp=date&0x01;Fre_check=0; /Delay1(1);_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_
5、nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();if(temp=1) Fre_check=1;Delay1(2,2);Fre_check=1;date=date1;unsigned char read_byte()unsigned char i,date;static bit j;for(i=8;i0;i-)date=date1;Fre_check=1;_nop_();_nop_();Fre_check=0;_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();Fre_check=1;_no
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 单片机 数码管 显示 温度 程序

限制150内