18b20测温c程序

时间:2013-06-12 06:16:45
【文件属性】:

文件名称:18b20测温c程序

文件大小:2KB

文件格式:RAR

更新时间:2013-06-12 06:16:45

18b20

/DS18B20温度传感器程序 #include #define Alarm 10 sbit Beep=P3^4; sbit DQ=P2^4; //数据传输线接单片机的相应的引脚 unsigned char tempL=0,tempH=0; //设全局变量 unsigned char flag=0; unsigned int temperature,negtemper; //温度值保存在temperature里 unsigned char idata addrdat[2]={0x0,0x0}; unsigned char tab[]={0xc0,0xf9,0xa4,0xb0, /* 0 1 2 3 4 */ 0x99,0x92,0x82,0xf8,0x80,0x90}; /* 5 6 7 8 9 */ unsigned char tab1[]={0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x78,0x00,0x10}; unsigned char dispbuf[3]={0,0,0}; unsigned char warning=30; bit on=1,off=0;


【文件预览】:
DS18B20xiugai.c

网友评论