#include
#define DS18B20_DIR
#define DS18B20_IN
#define DS18B20_OUT
#define DS18B20_DQ
#define DS18B20_DQ_2
// DS18B20 ROM指令宏界说
#define ReadRom
#define MatchRom
#define SearchRom
#define AlertSearch
#define CopyScratchpad
#define SkipRom
#define ReadPower
// DS18B20 功用指令宏界说
#define ConvertTemperature
#define ReadScratchpad
#define WriteScratchpad
#define RecallE
#define SMCLK
// 温度的十进制编码(查表用)
unsigned char decimalH[16]={00,06,12,18,25,31,37,43,50,56,62,68,75,81,87,93};
unsigned char decimalL[16]={00,25,50,75,00,25,50,75,00,25,50,75,00,25,50,75};
// 变量界说
unsigned char GetScratchpad[9];
unsigned char GetScratchpad_2[9];
float ResultTemperatureH;
float ResultTemperatureLH;
float ResultTemperatureLL;
float ResultTemperatureH_2;
float ResultTemperatureLH_2;
float ResultTemperatureLL_2;
float ResultTemperature;
float ResultTemperature_2;
float Temperaturefromtwo;
float OilPercentage;
void DS18B20_WriteBit(unsigned char oww_dat);
void DS18B20_WriteBit_2(unsigned char oww_dat);
void DS18B20_WriteByte(unsigned char oww_dat);
void DS18B20_WriteByte_2(unsigned char oww_dat);
void DS18B20_ReadTemp(void);
void DS18B20_ReadTemp_2(void);
unsigned char DS18B20_Init(void);
unsigned char DS18B20_Init_2(void);
unsigned char DS18B20_ReadBit(void);
unsigned char DS18B20_ReadBit_2(void);
unsigned char DS18B20_ReadByte(void);
unsigned char DS18B20_ReadByte_2(void);
void Delay10us(void);
void DelayX10us(unsigned char x10us);
void main(void) {
}
msp430单片机的ds18b20测温度c程序
includemsp430x16xh>defineDS18B20_DIRP2DIRdefineDS18B20_INP2INdefineDS18B20_OUTP2OUTdefineDS18B20_
声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/qianrushi/yingjian/257758.html