sensor_set_rate()

Set a sensor's refresh rate.

Synopsis:

#include <bps/sensor.h>
 
BPS_API int sensor_set_rate(sensor_type_t type, unsigned int rate)

Arguments:

type
The sensor to set the rate for.
rate
The rate to set (in microseconds).

Library:

libbps

Description:

The sensor_set_rate() function sets the rate at which the specified sensor should provide updates. The device attempts to achieve the specified rate, but this is not guaranteed; the sensor might provide updates more frequently or less frequently than the specified rate. The rate that you specify here corresponds roughly to the number of sensor events that are delivered to the event queue for your application.

Returns:

BPS_SUCCESS upon success, BPS_FAILURE with errno set otherwise.