欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標題: 單片機溫度檢測proteus仿真+代碼 [打印本頁]

作者: 7957    時間: 2019-2-27 18:03
標題: 單片機溫度檢測proteus仿真+代碼
部分源碼:
#include<reg51.h>
#define uchar unsigned char
#define uint unsigned int
uchar code table[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
sbit shi=P2^0;   
sbit ge=P2^1;
sbit DQ=P2^2;
sbit C=P2^3;   
sbit D=P2^4;
uint temp;
void delay(uint t)          //延時函數
{   while(t--);   }
void init_ds18b20( )     //DS18B20初始化
{
    uchar n;
    DQ=1;   delay(8);
    DQ=0;   delay(80);  
    DQ=1;   delay(14);   
    n=DQ;   delay(20);       
}
void write_byte(uchar dat)   //寫一個字節函數
{
    uchar i;
    for(i=0;i<8;i++)
    {
       DQ=0;   DQ=dat&0x01;
       delay(4);
       DQ=1;   dat=dat>>1;
    }
}
uchar read_byte( )    //讀一個字節函數
{
    uchar i,value;
    for(i=0;i<8;i++)
    {
       DQ=0;   value>>=1;
       DQ=1;   if(DQ)   value|=0x80;   delay(4);
    }
        return value;
}
uchar readtemperature( )    //讀取溫度函數
{
    uchar a,b;
        uint t=0;
        init_ds18b20();   write_byte(0xcc);   write_byte(0x44);
        init_ds18b20();   write_byte(0xcc);   write_byte(0xbe);
        a=read_byte();    b=read_byte();
        t=b;    t<<=8;    t=t|a;    t=t*0.0625+0.5;
        return t;
}

778[T2`W(}4XL`Y$UB03BMB.png (36.46 KB, 下載次數: 67)

778[T2`W(}4XL`Y$UB03BMB.png

單片機溫度檢測.rar

53.13 KB, 下載次數: 49, 下載積分: 黑幣 -5

Proteus仿真及代碼


作者: 原來是教教    時間: 2020-4-17 10:50
可以聯系一下嗎  想學習一下源碼
作者: 125216    時間: 2020-4-26 15:29
這是檢測溫度并報警嗎





歡迎光臨 (http://m.raoushi.com/bbs/) Powered by Discuz! X3.1