文件名称:DS18B20xiugai
介绍说明--下载内容均来自于网络,请自行研究使用
18b20测温的c语言程序/DS18B20温度传感器程序
#include <reg52.h>
#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 -18b20
#include <reg52.h>
#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 -18b20
(系统自动生成,下载前可以参看下载内容)
下载文件列表
DS18B20xiugai.c