資源簡介
at89c52
ds18b20
keil uvison4
proteus
代碼片段和文件信息
#include?“at89x52.h“
#define?uint?unsigned?int
#define?ulong? unsigned?long
#define?uchar?unsigned?char?//宏定義
sbit?DQ=P2^4?;????//定義DS18B20總線I/O
sbit?SET=P3^1;????//定義調整鍵
sbit?DEC=P3^2;????//定義減少鍵
sbit?ADD=P3^3;?????//定義增加鍵
sbit?BEEP=P3^7;????//定義蜂鳴器
bit?shanshuo_st;?????//閃爍間隔標志
bit?beep_st;??????//蜂鳴器間隔標志
uchar?x=0;???????//計數器
signed?char?m;??????//溫度值全局變量
uchar?n;???????//溫度值全局變量
uchar?set_st=0;??????//狀態標志
uchar?shangxian=38;???//上限報警溫度,默認值為38
uchar?xiaxian=5;????//下限報警溫度,默認值為5
uchar tmpbuf[5];
sbit Sign_Port =P3^0;
sfr Dat_Port =0x80;
sfr Cs_Port =0xa0;
bit?????fu;
uint?ReadTemperature(void)?;
uchar code?table[12]={0x3F0x060x5B0x4F0x660x6D0x7D0x07
??????????????????????????0x7F0x6F0x000x40};
/*****延時子程序*****/
void?Delay_DS18B20(int?num)
{
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????103929??2010-07-01?01:27??thermometer\Last?Loaded?thermometer.DBK
?????文件??????15060??2010-07-01?18:33??thermometer\thermometer
?????文件???????6028??2010-07-01?18:33??thermometer\thermometer.c
?????文件?????103929??2010-07-01?18:36??thermometer\thermometer.DSN
?????文件???????4542??2010-07-01?18:33??thermometer\thermometer.hex
?????文件?????????54??2010-07-01?18:33??thermometer\thermometer.lnp
?????文件??????13750??2010-07-01?18:33??thermometer\thermometer.LST
?????文件??????20040??2010-07-01?18:33??thermometer\thermometer.M51
?????文件??????16846??2010-07-01?18:33??thermometer\thermometer.OBJ
?????文件????????157??2010-07-01?22:21??thermometer\thermometer.plg
?????文件???????1054??2010-07-02?10:09??thermometer\thermometer.PWI
????.......?????55227??2010-07-01?22:21??thermometer\thermometer.uvopt
????.......?????13246??2010-06-30?21:21??thermometer\thermometer.uvproj
????.......?????55229??2010-07-01?18:36??thermometer\thermometer_uvopt.bak
????.......?????13247??2010-06-30?19:15??thermometer\thermometer_uvproj.bak
?????目錄??????????0??2010-07-02?10:09??thermometer
-----------?---------??----------?-----??----
???????????????422338????????????????????16
評論
共有 條評論