Contiki-Inga 3.x
Gyroscope Sensor

This sensor interface allows to control the gyroscope of the INGA sensor platform. More...

Data Output Channels

GYRO_X/Y/Z provide values for the respective axis in degree pre seconds (dps).

GYRO_X/Y/Z_RAW provide raw output values.

#define GYRO_X   0
 
#define GYRO_Y   1
 
#define GYRO_Z   2
 
#define GYRO_X_RAW   3
 
#define GYRO_Y_RAW   4
 
#define GYRO_Z_RAW   5
 
#define GYRO_TEMP   6
 

Configuration Types

Sensor specific configuration types.

#define GYRO_CONF_SENSITIVITY   10
 Configures the sensitivity. More...
 
#define GYRO_CONF_DATA_RATE   20
 Configures the output data rate. More...
 

SENSITIVITY Values

See Also
GYRO_CONF_SENSITIVITY
#define GYRO_250DPS   250
 
#define GYRO_500DPS   500
 
#define GYRO_2000DPS   2000
 

DATA_RATE Values.

See Also
GYRO_CONF_DATA_RATE
#define GYRO_100HZ   100
 
#define GYRO_200HZ   200
 
#define GYRO_400HZ   400
 
#define GYRO_800HZ   800
 

Detailed Description

This sensor interface allows to control the gyroscope of the INGA sensor platform.

Note
This interface provides only a subset of the full sensor features. If you require extended configuration, consider using the underlying sensor driver.

Configure sensor

acc_sensor.configure(type, value)

The sensor interface allows to configure:

Details of the different configurations are given in the documentation of respective config.

Query measurements

acc_sensor.value(channel)

The sensor provides 7 data channels.

Note
Measurement values are updated only if one channel is read twice. I.e. reading x,y, and z channel will provide values from a single measurement. If then one of these channels is read again, a new measurement is initated.

Example Usage

#include <sensors.h>
[...]
struct sensors_sensor gyrosensor = find_sensor("Gyro");
ACTIVATE_SENSOR(gyrosensor);
gyrosensor.configure(GYRO_CONF_SENSITIVITY, GYRO_250DPS);
[...]
int x = gyrosensor.value(GYRO_X);
int y = gyrosensor.value(GYRO_Y);
int z = gyrosensor.value(GYRO_Z);

Macro Definition Documentation

#define GYRO_CONF_DATA_RATE   20

Configures the output data rate.

The sensor can operate at different update rates (100,200,400,800 [Hz]). Allowed values can be found in DATA_RATE Values

Definition at line 129 of file gyro-sensor.h.

#define GYRO_CONF_SENSITIVITY   10

Configures the sensitivity.

The sensor can operate at three different sensitivity levels (+/-250,+/-500,+/-2000 [dps]). Possible values can be found in SENSITIVITY Values

Definition at line 124 of file gyro-sensor.h.