Skip to content
ejoerns edited this page Nov 6, 2013 · 8 revisions

The INGA platform contains multiple sensors that can be controlled with the standard Contiki sensor interface:

General Usage

#include "sensors.h"

Sensor lookup

The sensors_find() method can be used to get a pointer to a specific sensor. For that, each sensor can be identified by a string name.

struct sensors_sensor *mysensor;
mysensor = sensors_find("Name");
Sensor Name
Accelerometer "Acc"
Gyroscope "Gyro"
Pressure "Press"
Temperature "Temp"
Battery "Batt"

Sensor usage

All sensors share a common interface, that allows to activate/deactivate the sensor, configure it and read its data.

Activate sensor

SENSORS_ACTIVATE(sensor_name);

Deactivate sensor

SENSORS_DEACTIVATE(sensor_name);

Configure sensor

sensor_name.configure(type, value);

Readout sensor

sensor_name.value(NAME);