The value specified for bandwidth must match the settings that are valid for the
device, or else an error is indicated (SENSOR_ERR_PARAMS).
See the individual driver descriptions in Chapter 9 , page 27 for more information on
the valid bandwidth frequencies, default settings, etc.
6.3 Thresholds
Some sensor devices provide programmable thresholds that can be used to establish
a measurement level for detection of certain events. A typical example is an
accelerometer device which allows a motion detection threshold to be set – when the
sensor detects motion exceeding the threshold value, an externally visible event is
generated.
The sensor_set_threshold() function can be used to set these thresholds for
devices which have such capabilities. The function takes the following form:
sensor_set_threshold (&device, type, value);
where device is the device descriptor of the device, type is the type of threshold
being set, and value is the new threshold value. The value parameter is expressed in
the same units normally used for reading scaled data from the sensor (for example,
milli-g for an accelerometer device).
As an example, to set a motion detection threshold for an accelerometer device to
500 milli-g (0.5g), use the following:
sensor_set_threshold (&accel_dev, SENSOR_THRESHOLD_MOTION, 500);
Threshold detection is usually used together with sensor events. See Chapter 8 , page
22 for more information on generating and using sensor events.
6.4 Calibration
Typically, sensors require some level of per-device calibration in order to provide
accurate measurements. Often, the only required calibration is performed during the
manufacturing of the device (factory calibration), and the calibration values are stored
internally in the device. In other cases, it is necessary to calibrate the device in its
actual deployed state. For example, compass/magnetometer devices typically are
sensitive to the magnetic fields present in the final product (board, case, electrical
connections), and these must be offset in order to obtain accurate readings.
When a sensor requires explicit calibration in its deployed environment, the resulting
calibration values are often stored in nonvolatile memory within the microcontroller.
The sensor_calibrate() function allows your application to initiate and execute a
calibration sequence for a sensor. The calibration sequence is specific to the sensor
device. The sensor_calibrate() function takes a step number as an input
parameter to support devices that require multi-step calibration sequences (for
example, a series of measurements between which the user must physically
manipulate the device).
See the individual driver descriptions in Chapter 9, page 27 for more information on
calibration requirements and procedures.
12
Atmel AVR4016
8367B-AVR-06/11
相关PDF资料
ATAVRSBIN2 INERTIAL TWO SENSOR BOARD
ATAVRSBLP1 LIGHT AND PROXIMITY SENSOR BOARD
ATAVRSBPR1 BAROMETRIC PRESSURE ONE SNSR BRD
ATQT600 KIT EVAL TOUCH FOR QT600
ATU6-P305T-R CABLE CAT6 FULL-BOX 305M GRAY
ATUP-P305T-R CABLE CAT5E PULL-BOX 305M GRAY
ATUP-V305T-R CABLE CAT5E REEL 305M GRAY
AWG28-05/F-1/300-R CABLE 5 COND MULTI 300' RIBBON
相关代理商/技术参数
ATAVRSBIN2 功能描述:多功能传感器开发工具 9DOF Inertial Sensor Board 2 RoHS:否 制造商:Texas Instruments 工具用于评估:LMP91200 接口类型:SPI 工作电压:1.8 V to 5.5 V 最大工作温度:
ATAVRSBLP1 功能描述:光学传感器开发工具 Ambient Light and Proximity Snsr Brd RoHS:否 制造商:ams 工具用于评估: 接口类型: 最大工作温度:
ATAVRSBPR1 功能描述:压力传感器开发工具 Barometric Pressure Sensor Board 1 RoHS:否 制造商:Freescale Semiconductor 工具用于评估:MPL3115A2 接口类型:USB 最大工作温度:
ATAVRSECURITYX 功能描述:安全/ 验证开发工具 Security Module Kit for Xplain Series RoHS:否 制造商:Digi International 产品:Development Kits 工具用于评估:XEB-AW140 接口类型:SPI, USB 工作电源电压:3.1 V to 3.6 V
ATAVRSMD 功能描述:ADAPTER KIT SMD ICE200 RoHS:否 类别:编程器,开发系统 >> 过时/停产零件编号 系列:- 标准包装:1 系列:- 类型:MCU 适用于相关产品:Freescale MC68HC908LJ/LK(80-QFP ZIF 插口) 所含物品:面板、缆线、软件、数据表和用户手册 其它名称:520-1035
ATAVR-SOAKIT 功能描述:插座和适配器 Standoff Adapter Kit for JTAG debuggers RoHS:否 制造商:Silicon Labs 产品:Adapter 用于:EM35x
ATAVRTEMPSENSORX 功能描述:温度传感器开发工具 Temp Sensor kit for Xplain Series RoHS:否 制造商:Texas Instruments 产品类型:Temperature Sensors and Control ICs 工具用于评估:MSP430G2553 接口类型:USB 工作电源电压: 工作电源电流:
ATAVRTS2080A 功能描述:开发板和工具包 - AVR ATmega88 QTouch QTch kit w/SW librar RoHS:否 制造商:Arduino 产品:Evaluation Boards 工具用于评估:ATMega32U4 核心:AVR 接口类型:I2C, UART, USB 工作电源电压:6 V to 20 V