91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

使用stc12單片機串口使用433模塊進行通訊 通訊距離300+ 測試完成 附上電路圖 程序以及資料

資源截圖

代碼片段和文件信息

#include?“config.h“
#define?u8?unsigned?char
//串口接收數(shù)據(jù)緩存數(shù)組
extern?xdata?u8?uart1_shou[uatr];//串口1?接收的數(shù)據(jù)
extern?xdata?u8?uart2_shou[uatr];//串口2??接受的數(shù)據(jù)
extern?xdata?u8?uart3_shou[uatr];//串口1?接收的數(shù)據(jù)
extern?xdata?u8?uart4_shou[uatr];//串口2??接受的數(shù)據(jù)
extern?int?mode1;
extern?int?mode2;
extern?int?mode3;
extern?int?mode4;
//溫度讀取??變量
uint?temp1=0;?????????????//?18b202溫度數(shù)據(jù)
bit?run_18b20=1;//溫度報警啟動標志位??1啟動報警
bit?shou_18b20=1;//測試??只發(fā)送一次報警


unsigned?char?ds_18b20num[]={“D00.0“}; //用來保存溫度
unsigned?char?ds_18b20H[]={“D30.5“}; //語音報警上限
unsigned?char?ds_18b20L[]={“D20.5“}; //語音報警下限


extern?unsigned?char?ADC_nume[7];//光敏數(shù)據(jù)保存
?bit?ET0_run=0;?


bit?cbs=0;//超聲波檢測???檢測人體
//函數(shù)聲明
void?key();//按鍵控制函數(shù)
void?ds18b20_num();///溫度讀取轉(zhuǎn)換成字符函數(shù)
void?eerom();//eerom上電初始化函數(shù)

void?main(void)
{??????????????????
//串口初始化

??io_init();//io引腳初始化
Uart1Init();//串口1??初始化
Uart2Init();//串口2??初始化
Uart3Init();//串口3??初始化
Uart4Init();//串口4??初始化
Timer0Init();
eerom();//EEROM操作函數(shù)
delay_ms(1000);//延時1秒鐘???防止電腦上位機反應(yīng)不過來
while(1)?
{??
?UART_1();//藍牙接口?以及上位機通訊使用
?UART_2();//語音模塊播報使用
//?UART_3();//備用??可以外接串口
//UART_4();//暫時沒有用到此串口
?ds18b20_num();//溫度讀取轉(zhuǎn)換成字符數(shù)據(jù)
?ADC_shou();//檢測光敏數(shù)據(jù)
?key();//板載按鈕控制
}
}

void?ds18b20_num()
{


int?wendu_h;//標志位??檢測溫度是否超過上限
int?wendu_l;//標志位??檢測溫度是否低于下限

ET0?=?0;//關(guān)閉定時器中斷??防止擾亂18b20的時序????
tmpchange(); ??//讀取溫度
?? temp1=ds_tmp(); ??//溫度賦值
ET0?=?ET0_run;???//根據(jù)標志位判斷是否打開定時器的中斷



??ds_18b20num[0]=‘D‘;
ds_18b20num[1]=(temp1/100)+48;? //將溫度轉(zhuǎn)換成字符型
ds_18b20num[2]=(temp1/10%10)+48;?
??ds_18b20num[4]=(temp1%10)+48;
//檢測溫度值是否大于低于設(shè)定的上限下限
if(temp1!=850)
{
wendu_h=strcmp(ds_18b20numds_18b20H);
wendu_l=strcmp(ds_18b20numds_18b20L);
if(wendu_h>0&&run_18b20&&shou_18b20)//溫度大于報警值
{
shou_18b20=0;

UART(1“溫度上限報警當(dāng)前溫度為??“);
UART(1ds_18b20num);
UART1_SendLR()?;
UART(1“溫度上限為???“);
UART(1ds_18b20H);
UART1_SendLR()?;
UART(1“溫度下限為??“);
UART(1ds_18b20L);
UART1_SendLR()?;
}
else?if(wendu_l<0&&run_18b20&&shou_18b20)//溫度低于下限
{
shou_18b20=0;
UART(1“溫度下限報警當(dāng)前溫度為??“);
UART(1ds_18b20num);
UART1_SendLR()?;
UART(1“溫度上限為???“);
UART(1ds_18b20H);
UART1_SendLR()?;
UART(1“溫度下限為??“);
UART(1ds_18b20L);
UART1_SendLR()?;
}
if(wendu_l>0&&wendu_h<0)//溫度在中間??未發(fā)生報警值
{
shou_18b20=1;
}
}


}
void?key()//板載按鍵操作函數(shù)
{


if(key1==0)
{
delay_ms(20);
if(key1==0)
{
UART(2“繼電器“);
}
while(!key1);
}



if(key2==0)
{
delay_ms(20);
if(key2==0)
{
UART(2“蜂鳴器“);
}
while(!key2);
}

}

void?eerom()
{
unsigned?char?eerom_shou; //
eerom_shou?= IapReadByte(IAP_ADDRESS);//讀取一個字節(jié)???判斷是否為D??

if(eerom_shou!=‘D‘) //不是D說明?第一次上電??進行數(shù)據(jù)的初始化
{
IapEra

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????94549??2019-09-20?09:09??433遙控\app\藍牙.e4a

?????文件?????237678??2019-09-20?09:09??433遙控\app\調(diào)試版_新的應(yīng)用.apk

????I.A....??????4418??2019-09-18?15:51??433遙控\PCB\主機模塊\Integrated_Library\History\Integrated_Library.~(1).LibPkg.Zip

?????文件??????40809??2019-09-18?15:51??433遙控\PCB\主機模塊\Integrated_Library\Integrated_Library.LibPkg

?????文件?????151040??2019-09-18?15:51??433遙控\PCB\主機模塊\Integrated_Library\PCB1.PcbDoc

?????文件???????4608??2019-09-18?15:52??433遙控\PCB\主機模塊\Integrated_Library\Project?Outputs?for?Integrated_Library\Integrated_Library.IntLib

?????文件??????13312??2019-09-18?15:51??433遙控\PCB\主機模塊\Integrated_Library\Sheet1.SchDoc

?????文件???????4543??2019-09-18?15:51??433遙控\PCB\主機模塊\Integrated_Library\__Previews\PCB1.PcbDocPreview

?????文件??????16984??2019-09-18?15:51??433遙控\PCB\主機模塊\Integrated_Library\__Previews\Sheet1.SchDocPreview

?????文件???????4418??2019-09-18?15:51??433遙控\PCB\從機模塊\Integrated_Library\History\Integrated_Library.~(1).LibPkg.Zip

?????文件??????40809??2019-09-18?15:51??433遙控\PCB\從機模塊\Integrated_Library\Integrated_Library.LibPkg

?????文件?????151040??2019-09-18?15:51??433遙控\PCB\從機模塊\Integrated_Library\PCB1.PcbDoc

?????文件???????4608??2019-09-18?15:52??433遙控\PCB\從機模塊\Integrated_Library\Project?Outputs?for?Integrated_Library\Integrated_Library.IntLib

?????文件??????13312??2019-09-18?15:51??433遙控\PCB\從機模塊\Integrated_Library\Sheet1.SchDoc

?????文件???????4543??2019-09-18?15:51??433遙控\PCB\從機模塊\Integrated_Library\__Previews\PCB1.PcbDocPreview

?????文件??????16984??2019-09-18?15:51??433遙控\PCB\從機模塊\Integrated_Library\__Previews\Sheet1.SchDocPreview

?????文件??????79870??2019-09-20?08:01??433遙控\Schematic?Prints.pdf

?????文件???????1533??2019-09-20?08:52??433遙控\從機程序\ADC.C

?????文件????????180??2019-08-09?09:15??433遙控\從機程序\ADC.h

?????文件???????2852??2019-09-20?09:12??433遙控\從機程序\ADC.LST

?????文件??????11196??2019-09-20?09:12??433遙控\從機程序\ADC.OBJ

?????文件??????31035??2018-12-01?17:57??433遙控\從機程序\codetab.h

?????文件???????1061??2019-09-20?08:48??433遙控\從機程序\config.h

?????文件???????1834??2019-09-20?08:52??433遙控\從機程序\DS18B20.C

?????文件????????441??2019-09-20?08:13??433遙控\從機程序\DS18B20.H

?????文件???????4337??2019-09-20?09:12??433遙控\從機程序\DS18B20.LST

?????文件??????14147??2019-09-20?09:12??433遙控\從機程序\DS18B20.OBJ

?????文件???????7680??2019-05-11?16:10??433遙控\從機程序\LQ12864.h

?????文件???????3739??2019-09-20?08:56??433遙控\從機程序\main.c

?????文件???????7326??2019-09-20?09:12??433遙控\從機程序\main.LST

............此處省略108個文件信息

評論

共有 條評論