資源簡介
溫度檢測(DS8B20)
代碼片段和文件信息
#include
#include“hardware.h“
#include“DS18B20.h“
#define?Lock_on?1;
#define?Lock_off?0;
#define?sth_on?1;
#define?sth_off?0;
unsigned?char?code?SegD_fuhao[4]?=?{0x000x400x770x3e};
unsigned?char?code?SegD_jiadian[11]={0xbf0x860xdb0xcf0xe60xed0xfd0x870xff0xef0x00};
unsigned?char?code?SegD_Ca[11]?=?{0x3f0x060x5b0x4f0x660x6d0x7d0x070x7f0x6f0x00};
unsigned?char?code?SegW_Ca[6]?=?{0xfe0xfd0xfb0xf70xef0xdf};
unsigned?char?xian[6]={000000};
unsigned?int?shu_1shu_2shu_3shu_4;
unsigned?int?add=0mun=0i=0c=0l=0h;
unsigned?int?temp_num;
unsigned?char?lw?hh;
void??Fuzhi_shu(void); ? //計算各個數(shù)碼管顯示值
void?Display(void);
void?main(void)
{
TMOD?=?0x01;
TH0?=?(65536-1000)/256;
TL0?=?(65536-1000)%256;
TR0?=?1;??EA?=?1;??ET0?=?1;
while(1)
{
Ds18B20_Ack(); ????????????//Ds18B20是否存在探測
? Ds18B20_WrByte(0x4e); //任一Ds18B20寫一個字節(jié)
?? Ds18B20_RdByte(); //從Ds18B20讀一個字節(jié)
? Ds18B20_Temp_Conv(); //啟動溫度轉換
? if(i==750&&mun==
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????2546??2020-03-31?19:01??6.plg
?????文件???????57694??2020-05-24?13:42??6.uvopt
?????文件???????13626??2020-04-10?22:15??6.uvproj
?????文件???????57692??2020-05-19?15:48??6_uvopt.bak
?????文件???????13603??2020-03-31?20:28??6_uvproj.bak
?????目錄???????????0??2020-03-31?19:44??inc\
?????文件?????????381??2020-03-31?19:59??inc\DS18B20.h
?????文件?????????428??2020-03-31?19:35??inc\hardware.h
?????目錄???????????0??2020-04-10?22:15??li
?????文件???????13471??2020-04-10?22:15??li
?????文件????????4661??2020-04-10?22:15??li
?????文件????????5359??2020-04-10?22:15??li
?????目錄???????????0??2020-04-10?22:15??output\
?????文件???????12968??2020-04-10?22:15??output\6
?????文件????????2867??2020-04-10?22:15??output\6.hex
?????文件??????????83??2020-04-10?22:15??output\6.lnp
?????文件?????????170??2020-05-24?13:42??output\6.plg
?????文件????????8215??2020-04-10?22:15??output\main.obj
?????文件????????7065??2020-04-10?22:15??output\temp.obj
?????目錄???????????0??2020-03-31?18:39??scr\
?????文件????????2018??2020-04-01?16:02??scr\main.c
?????文件????????1912??2020-04-01?16:28??scr\temp.c
?????文件???????????0??2020-04-10?22:15??temp.h
?????目錄???????????0??2020-04-01?11:59??圖\
?????文件????????3101??2020-03-31?21:38??圖\5.pdsprj.dd-PC.dd.workspace
?????文件???????22958??2020-04-15?22:49??圖\6.pdsprj
?????文件????????2950??2020-05-19?15:56??圖\6.pdsprj.dd-PC.dd.workspace
?????文件???????22958??2020-03-31?20:06??圖\Backup?Of?5.pdsbak
?????文件???????22956??2020-03-31?21:18??圖\Last?Loaded?5.pdsbak
?????文件???????22957??2020-04-01?14:56??圖\Last?Loaded?6.pdsbak
評論
共有 條評論