Functions to read various input sensors on the device.
This file defines the sensor service, which provides functions for reading the various input sensors that are available on the device, including the accelerometer, magnetometer, temperature, illuminance, and so on.
The supported sensors are listed by the enumeration sensor_type_t . To start receiving sensor events, call sensor_request_events() and pass in the sensor type. To set the refresh rate of the sensor, call the sensor_set_rate() function. To specify whether duplicate sensor events should be skipped, call the sensor_set_skip_duplicates() function.
The sensors return a variety of different data, so depending on which sensor you want to use, you need to call a different sensor_event_get_* function to retrieve the readings. See the individual functions to determine which sensors they work with.
To stop receiving sensor events, call the sensor_stop_events() function.