forked from ejoerns/contiki-inga
-
Notifications
You must be signed in to change notification settings - Fork 13
Sensors
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:
#include "sensors.h"
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" |
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);