资源简介
CC2530读取光照传感器BH1750数据,已通过验证,可以正常使用

代码片段和文件信息
/************************************************
connect all the event to the interrupt1
**************************************************/
#include “Detect.h“
#include “MMA845X.h“
#include “IIC.h“
#include “Timer.h“
#include “ioCC2530.h“
unsigned char IntSourceMotion;
unsigned char IntSourceFF;
unsigned char IntSourceTrans;
unsigned char State;
//unsigned char Data[6];
void TransientDetectInit(unsigned char SlaveAddress)
{
RegWrite(SlaveAddress0x2A 0x18); //Set device in 100 Hz ODR Standby
RegWrite(SlaveAddress0x1D 0x16); //Enable Latch Enable X and Enable Y
RegWrite(SlaveAddress0x1F 0x20); //set the threshold 2g 判断是否发生了撞击
RegWrite(SlaveAddress0x20 0x05); //ODR=100HZ 10ms per step size. set the debounce counter for 50 ms
RegWrite(SlaveAddress0x2D 0x20); //enable transition detection interrupt in the system control register.
// RegWrite(SlaveAddress0x2E 0x20); //route the transient int to INT1 hardware pin
RegWrite(SlaveAddress0x2E 0x00); //route the transient int to INT2 hardware pin
RegWrite(SlaveAddress0x2A(RegRead(SlaveAddress0x2A)|0x01)); //put the device into active mode
}
void MotionDetectInit(unsigned char SlaveAddress)
{
RegWrite(SlaveAddress0x2A 0x18); //Set the device in 100 Hz ODR Standby
RegWrite(SlaveAddress0x15 0xD8); //set the configuration for motion detection by setting the “OR“ condition OAE=1enableing XY and the latch
RegWrite(SlaveAddress0x17 0x30); //threshold setting value for the motion detection of>3g
RegWrite(SlaveAddress0x18 0x0A); //now step time is 10ms.set the debounce counter to eliminate false reading for 100HZ sample rate with a requirement of 100ms timer
RegWrite(SlaveAddress0x2D 0x04); //Enbale motion/freefall interrupt function in the system
RegWrite(SlaveAddress0x2E 0x04); //route the MF interrupt function to int1 pin
RegWrite(SlaveAddress0x2ARegRead(SlaveAddress0x2A)|0x01); //put the device in active mode
}
void FreefallDetectInit(unsigned char SlaveAddress)
{
RegWrite(SlaveAddress0x2A 0x20); //Set the device in 50 Hz ODR Standby
RegWrite(SlaveAddress0x15 0xB8); //configuration register set for freefall detection enabling “AND“ conditionOAE=0enabling xyz and the latch
RegWrite(SlaveAddress0x17 0x0C); //threhold setting value for resulting acceleration<0.75g
RegWrite(SlaveAddress0x18 0x02); //set the debounce to eliminate false positive reading for 50HZ sample rate with reqirement of 40ms timerassuming normal mode
RegWrite(SlaveAddress0x2D 0x04); //enable MF interrupt function in the system
RegWrite(SlaveAddress0x2E 0x04); //route the MF interrupt function int1 harware pin
RegWrite(SlaveAddress0x2ARegRead(SlaveAddress0x2A)|0x01);
}
void FallEventInit(unsigned char SlaveAddress)
{
RegWrite(SlaveAddress0x2A 0x18); //设置采样率
RegWrite(SlaveAddress0x15 0xB8); //设置自由落体测量模式,并使能在X,Y,Z三个方向上面测量
RegWrite(SlaveAddres
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-03-15 21:29 BH1750程序forCC2530\
目录 0 2012-09-20 14:38 BH1750程序forCC2530\Debug\
目录 0 2014-03-15 21:29 BH1750程序forCC2530\Debug\Exe\
文件 26069 2012-09-10 16:37 BH1750程序forCC2530\Debug\Exe\IIC.hex
目录 0 2014-04-15 22:56 BH1750程序forCC2530\Debug\List\
目录 0 2014-03-15 21:29 BH1750程序forCC2530\Debug\Obj\
文件 38127 2012-09-10 16:37 BH1750程序forCC2530\Debug\Obj\Detect.r51
文件 707 2011-04-19 14:19 BH1750程序forCC2530\Debug\Obj\FMDetect.pbi
文件 539 2012-09-10 16:37 BH1750程序forCC2530\Debug\Obj\IIC.pbd
文件 31161 2012-09-10 16:37 BH1750程序forCC2530\Debug\Obj\IIC.r51
文件 4941 2012-09-10 16:37 BH1750程序forCC2530\Debug\Obj\MMA845X.r51
文件 1245 2011-04-09 20:23 BH1750程序forCC2530\Debug\Obj\Terminal.r51
文件 5005 2012-09-10 16:37 BH1750程序forCC2530\Debug\Obj\Timer.r51
文件 5403 2012-09-10 16:37 BH1750程序forCC2530\Debug\Obj\Uart.r51
文件 20169 2012-09-10 16:37 BH1750程序forCC2530\Debug\Obj\main.r51
文件 8990 2012-09-10 17:28 BH1750程序forCC2530\IIC.dep
文件 26857 2011-04-07 10:48 BH1750程序forCC2530\IIC.ewd
文件 53926 2011-05-01 11:58 BH1750程序forCC2530\IIC.ewp
文件 157 2011-04-07 10:48 BH1750程序forCC2530\IICforCC2530.eww
目录 0 2014-03-15 21:29 BH1750程序forCC2530\settings\
文件 2494 2012-09-10 17:28 BH1750程序forCC2530\settings\IIC.cspy.bat
文件 6243 2012-09-10 17:28 BH1750程序forCC2530\settings\IIC.dbgdt
文件 735 2012-09-10 17:28 BH1750程序forCC2530\settings\IIC.dni
文件 3986 2012-09-10 17:28 BH1750程序forCC2530\settings\IICforCC2530.wsdt
目录 0 2014-03-15 21:29 BH1750程序forCC2530\source\
文件 11497 2011-05-01 12:06 BH1750程序forCC2530\source\Detect.c
文件 1249 2011-04-30 21:15 BH1750程序forCC2530\source\Detect.h
文件 5820 2011-05-01 17:56 BH1750程序forCC2530\source\IIC.c
文件 1255 2011-05-01 17:56 BH1750程序forCC2530\source\IIC.h
文件 892 2011-04-12 10:42 BH1750程序forCC2530\source\MMA845X.c
文件 19534 2012-08-13 21:59 BH1750程序forCC2530\source\MMA845X.h
............此处省略5个文件信息
相关资源
- cc2530寄存器手册
- IEEE 802.15.4的CC2530无线数据收发设计
- IEEE 802.15.4的CC2530无线数据收发设计
- ZStack-CC2530-2.5.1a
- 基于ZigBee温室环境监测系统电路设计
- 智能分户供暖监控系统的无线温控器
- CC2530的分布式无线数据采集系统设计
- CC2530 BasicRFTI源文件
- BH1750光照模块
- cc2530-contiki读取DHT11并发送数据例程
- CC2530中文数据手册完全版.pdf
- CC2530 (zigbee) 中文数据手册完全版
- GY-302 BH1750光照强度模块资料与代码
- SampleApp_dht11.zip
- zigbee基于cc2530指导
- 基于cc2530的温湿度检测点对点无线传
- 基于CC2530的温湿度数据采集系统
- 基于cc2530的zigbee的无线led灯控制程序
- STM32驱动BH1750环境光强度传感器(GY
- TI公司推出的CCS3.3开发环境中文入门指
- 基于Zigbee的室内自定位
- 完整工程串口12、DHT11、BH1750、mh-z14
- Zigbee CC2530 振动传感器开发源码 项目
- Zigbee CC2530 酒精传感器开发源码
- Zigbee CC2530 火焰传感器开发源码
- CC2530+DHT11温湿度传感器+HC-SR04超声波传
- STM32F103+温湿度+光照强度+LN33无线网络
- cc2530中文数据手册完全版
- Zigbee CC2530模块电路图和原理图
- STM32和CC2530串口通信
评论
共有 条评论