Atmel AVR4016
The sensor_data_t structure also contains a special field which is set by your
application to specify whether the sensor read function should return scaled units or
raw readings. This field should be set before calling the sensor read function.
The final field in the sensor_data_t structure is a high-resolution timestamp value
that provides an elapsed time value, expressed in microseconds (μs). This field is
updated during each sensor reading using an internal Atmel AVR system clock.
7.1.3 Measurement units
The Atmel Sensors Xplained API functions provide sensor results in real-world
(usually scientific or SI) units. These values are automatically scaled based on the
current device settings. And so if the output range setting for a device is changed, for
example, the scaled output will remain the same (subject to limitations of the device’s
precision in each range).
Many sensor readings are provided directly by the device, but require scaling or other
conversion to SI units. Other results (for example, magnetic heading) are calculated
by the Sensors Xplained functions based on lower-level sensor readings.
See Table 7-1 for the measurement units used for each type of sensor reading.
7.1.4 Reading “raw” values
Although it is normally preferable to obtain scaled values for sensor data, it is also
possible to read the internal “raw” values from the sensor. Raw values may be useful
for system setup or calibration, or for special operations that are specific to the sensor
being used.
To read raw values from a sensor device, set the scaled field in the sensor_data_t
data structure to false before calling the sensor’s read function (for example,
sensor_get_acceleration() or sensor_get_pressure() ).
When raw values are returned, they are not modified by the read function, and so the
actual values will vary, depending on the range setting for the device. However,
calibration offsets (such as those used for compass/magnetometer sensors) will be
applied to the returned values.
7.1.5 Timestamps
The timestamp field in the sensor_data_t structure is automatically filled with a
microsecond (μs) value from the AVR controller’s real-time clock when the sensor is
read. These timestamps can be used to determine the relative timing of multiple
sensor readings.
When the sensor read function returns, the timestamp can be read from the
sensor_data_t structure’s timestamp field.
7.2 Device ID and version
Most sensor devices provide an identifier value that can be read to determine the
sensor model. In many cases, the device version can also be read. The
sensor_device_id() function is a special routine that reads these values from the
sensor device and returns them in a sensor_data_t structure, similar to the way that
the actual sensor readings are returned. The function takes the following form:
sensor_device_id (&device, &id_data);
15
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