lesson11-1数字温度传感器ds18b20,采用3位数码管显.docVIP

  • 7
  • 0
  • 约7.17千字
  • 约 11页
  • 2018-09-25 发布于辽宁
  • 举报

lesson11-1数字温度传感器ds18b20,采用3位数码管显.doc

lesson11-1数字温度传感器ds18b20,采用3位数码管显

Lesson11-1:数字温度传感器DS18B20,采用3位数码管显示,仿真通过 #include reg51.h #define uchar unsigned char #define uint unsigned int sbit DS=P2^2; // 定义DS18B20接口 uchar time=100; sbit dula=P2^6; sbit wela=P2^7; uchar code table[]= {0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07, 0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};//不带小数点编码。 uchar code table1[]= {0xbf,0x86,0xdb,0xcf,0xe6,0xed,0xfd,0x87,0xff,0xef}; //带小数点编码。 void mdelay(uint z) { uint x,y; for(x=z;x0;x--) for(y=110;y0;y--); } ///////功能:串口初始化,波特率9600,方式1/////// void Init_Com(void) { TMOD = 0x20; PCON = 0x00; SCON = 0x50;

文档评论(0)

1亿VIP精品文档

相关文档