基于CC2530的zIgbee传感器无线数据采集系统开发(部分关键源码)

圆形出风口
基于CC2530的zIgbee传感器⽆线数据采集系统开发(部分关
键源码)
这是本⼈的⼀个⼩项⽬,分享给⼤家,有什么错误的地⽅,还请⼤家指导(完整的⼯程⽂件已经上传到资源了)
⼯程的数据包格式为:
|--|--|-----,------,-----|----------------|---|
|数据包长度|数据包序号|数据1,数据2,数据3|数据|异或校验|
|31|01|00000,01200,02003|eab12345ddfd998a|9fd|
串⼝⾃检测设计(可⽤来设计上位机⾃检测串⼝):
向串⼝发送字符串FC
串⼝返回字符串FE
项⽬包含的传感器有:
最后测试结果
P2.5 OK  P0_7  序号5                                              成功
DHT11 OK      P1_1        序号1                                          成功
⼈体红外        待检验 序号2                                              成功        未检出输出1
MQ2        OK    P1_2        序号3                                          成功  未检出输出0
MQ7                待检验 序号10                                          成功  未检出输出0
⾬滴                待检验 序号9                                              成功  未检出输出1
⼟壤湿度        待检验 序号6                                              成功  未检出输出1
光敏            待检验序号12                                          成功  未检出输出1
DS18B20 OK  P0_6  序号13                                    成功  输出结果形如264表                                                                          ⽰26.489c2051
MQ3        OK    P2_0        序号14                                        成功  未检出输出1
MQ4        OK    P2_0        序号15                                        成功  未检出输出1
MQ8        OK    P2_0        序号16                                        成功  未检出输出0
MQ135  OK    P2_0        序号17                                        成功  未检出输出1
ULTRASONIC OK P1_0 P0_0 序号18//超声波                      成功
倾斜 OK  P1_2  序号19                                  成功  未发⽣倾倒输出1
轻触开关  OK  P2_0序号20                                          成功  未按输出1
麦克风  OK  P2_0序号21                              成功  没声⾳输出1
⼲簧管  OK  P2_0序号22                              成功  ⽆信号输出0
红外光电        OK  P2_0 序号23                                    成功  ⽆光输出0
双路光敏  OK  P0-1 P0-2 序号24                              成功  ⽆光输出 1 1
⽕光检测  OK  P1-2    序号25                              成功  ⽆⽕光输出1
测速模块        OK P1_2    序号26                                  成功  有障碍物阻挡输出1
电流模块        OK P1_2  序号27                                    成功  电流未通过输出0
继电器    OK  P1_3  命令代码字符串“FD”            成功
加速度    OK          序号28                                  成功        未区分正负
霍尔开关  OK  P2_0  序号29                                    成功  未检出输出1
电⼦陀螺仪 OK  P1_6(SCL) P1_7(SDA)  序号30 成功  输出为213 4                                                                              (213.4)
接近开关        OK P2_0  序号31                                    等待测试
ADXL345数字三轴重⼒加速度倾斜度模块 序号32      成功    未区分正负
GY30                                              序号33      成功      未区分正负
部分传感器功能没有完全使⽤,若需详细数据请⼤家结合传感器功能⾃⾏设计
SampleApp.C
/**************************************************************************************************
Filename:      SampleApp.c
Revised:        $Date: 2009-03-1815:56:27 -0700 (Wed, 18 Mar 2009) $
Revision:      $Revision: 19453 $
Description:    Sample Application(no Profile).
Copyright 2007 Texas Instruments Incorporated. All rights reserved.水控系统
IMPORTANT: Your use of this Software is limited to those specific rights
granted under the terms of a software license agreement between the user
whodownloaded the software, his/her employer (which must be your employer)
andTexas Instruments Incorporated (the "License").  You may not use this
Software unless you agree to abide by the terms of the License. TheLicense
limits your use, and you acknowledge, that the Software may not bemodified,
copied or distributed unless embedded on a Texas Instrumentsmicrocontroller
orused solely and exclusively in conjunction with a Texas Instruments radio
计算机取证工作站frequency transceiver, which is integrated into your product.  Other than for
theforegoing purpose, you may not use, reproduce, copy, prepare derivative
works of, modify, distribute, perform, display or sell this Softwareand/or
itsdocumentation for any purpose.
YOUFURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE  PROVIDED 揂S IS?WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDERCONTRACT,
NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
ORCONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
OFSUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILARCOSTS.
Should you have any questions regarding your right to use this Software,
contact Texas Instruments Incorporated at www.TI.
**************************************************************************************************/
/*********************************************************************
This application isn't intended to do anything useful, it is
intended to be a simple example of an application's structure.
This application sends it's messages either as broadcast or
透视望远镜
broadcast filtered group messages. The other (more normal)
message addressing is unicast. Most of the other sample
applications are written to support the unicast message model.
Keycontrol:
SW1:  Sends a flash command to alldevices in Group 1.
SW2:  Adds/Removes (toggles) thisdevice in and out
of Group 1.  This will enable anddisable the
reception of the flash command.
*********************************************************************/
/
*********************************************************************
*INCLUDES
*/
#include "OSAL.h"
#include "ZGlobals.h"
#include "AF.h"
#include "aps_groups.h"
#include "ZDApp.h"
#include "SampleApp.h"
#include "SampleAppHw.h"
#include "OnBoard.h"
/
* HAL */
#include "hal_lcd.h"选金工艺
#include "hal_led.h"
#include "hal_key.h"
#include "MT_UART.h"
#include "MT_APP.h"
#include "MT.h"
#include "DHT11.h"
#include "RE200B.h"
#include "Ascii_to_bcd.h"
#include "crc.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "BCD_To_ASCII.h"
#include "sht11.h"
#include "MQ7.h"
#include "Light.h"
#include "Rain.h"
#include "PH.h"
#include"PM2_5.h"
#include"ds18b20.h"
#include"HMC5388L.h"
#include"ultrasonic.h"
#include"Bais.h"
#include"YF.h"
#include"mic.h"
#include"ghg.h"
#include"inf_photo.h"
#include"TWO_LIGHTS.h"
#include"FIRE.h"
#include"SPEED.h"
#include"CURRENT.h"
#include"SDR_SENSOR.h"
#include"mma8451.h"
#include"huer_switch.h"
#include"app_switch.h"
#include"ADXL345.h"
#include"GY30.h"
#define MAXLEN 128
unsigned char temp_ASCII[128]={0}; unsigned char temp_BCD[128]={0}; unsigned char data_package[128]={0};

本文发布于:2024-09-24 11:31:30,感谢您对本站的认可!

本文链接:https://www.17tex.com/tex/2/170470.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:输出   数据   序号   检出   字符串   传感器
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议