digthermo.h
来自「此程序实现了ds18b20温度传感器的单线数据采集」· C头文件 代码 · 共 24 行
H
24 行
#ifndef _DIGTHERMO_H // 防止DigThermo.h被重复引用
#define _DIGTHERMO_H
#include <reg52.h> // 引用标准库的头文件
#include "intrins.h"
#define uchar unsigned char
#define uint unsigned int
uchar tplsb,tpmsb; // 温度值低位、高位字节
sbit DQ = P3^0; // 数据通信线DQ
unsigned char code dispcode[]={0x3f,0x06,0x5b,0x4f, //0,1,2,3
0x66,0x6d,0x7d,0x07, //4,5,6,7
0x7f,0x6f,0x77,0x7c, //8,9,a,b
0x39,0x5e,0x79,0x71,0x40,0x00}; //c,d,e,f,-,不显示
unsigned char dispbitcode[]={0xfe,0xfd,0xfb,0xf7, //LED位码
0xef,0xdf,0xbf,0x7f};
unsigned char display[8]={0,0,0,0,0,0,0,0};
uchar get_serial[]={0x8e,0x00,0x00,0x00,0xb8,0xc5,0x30,0x28,0xb9,0x00,0x00,0x00,0xb8,0xc5,0x31,0x28,
0xe0,0x00,0x00,0x00,0xb8,0xc5,0x32,0x28};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?