云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 基于单片机的火灾报警系统设计 - 图文

基于单片机的火灾报警系统设计 - 图文

  • 62 次阅读
  • 3 次下载
  • 2025/6/25 18:48:42

西安工程大学本科毕业设计(论文)

系统源程序

发送侧部分程序

#include #include\#include\#include\#include\#include\void main(void) {

uchar i; LCD_Init(); TX_Mode();

LCD_Str(0,0,\

while(NRF24L01_Check()) //检测24L01 { }

LCD_Str(3,0,\delay_ms(500);

//显示Ready! 500ms后清空显示

LCD_Str(3,0,\delay_ms(200);

LCD_Str(3,0,\delay_ms(200);

LCD_Str(3,0,\TX_Mode(); while(1) {

38

西安工程大学本科毕业设计(论文)

}

Check_Sensor_Sta( ); }

for(i=15;i<18;i++)

//发送传感器信号

Buff[i]=SENSOR_STA[i-15]+0x30;

Buff[i]='\\0'; for(i=0;i<8;i++) Buff[i]=str[i]; Temp_Change(++i);

//发送温度数

if(NRF24L01_TxPacket(Buff)==TX_OK) { } else { }

delay_ms(30000);

LCD_Str(12,1,\LCD_Str(12,1,\LCD_Str(3,0,\LCD_Str(0,1,\LCD_Str(6,1,\LCD_Char(7,0,Buff[15]); LCD_Char(4,1,Buff[16]); LCD_Char(10,1,Buff[15]);

接受测部分程序

#include #include\#include\

39

西安工程大学本科毕业设计(论文)

#include\#include\

#define uint unsigned int uchar Buff[32]; uchar Num[5]; sbit LED0=P0^0;

void Display_Num(uchar x,uchar y,uint num); void main(void) {

uint t; LCD_Init();

LCD_Str(0,0,\RX_Mode();

while(NRF24L01_Check())//检测不到24L01 { }

LCD_Str(3,0,\delay_ms(500);

LCD_Str(3,0,\delay_ms(200);

LCD_Str(3,0,\delay_ms(200);

LCD_Str(3,0,\while(1) {

if(NRF24L01_RxPacket(Buff)==0)//一旦接收到信息,则显示出来. {

LCD_Str(9,1,\

40

西安工程大学本科毕业设计(论文)

}

LCD_Str(3,0,\LCD_Str(9,0,\LCD_Str(3,1,\LCD_Str(12,1,&Buff[9]); LCD_Char(7,0,Buff[15]);

LCD_Char(13,0,Buff[16]); LCD_Char(7,1,Buff[17]);

if(Buff[15]==48||Buff[16]==48||Buff[17]==48||Buff[9]>=4+0x30) }

}

else delay_ms(1); t++;

if(t==100)//大约1s钟改变一次状态 {

t=0; LED0=!LED0; warn(2);

}

41

  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

西安工程大学本科毕业设计(论文) 系统源程序 发送侧部分程序 #include #include\#include\#include\#include\#include\void main(void) { uchar i; LCD_Init(); TX_Mode(); LCD_Str(0,0,\while(NRF24L01_Check()) //检测24L01 { } LCD_Str(3,0,\delay_ms(500); //显示Ready! 500ms后清空显示 LCD_Str(3,0,\delay_ms(200);

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com