readDigitalSensor - VCSFA-MARS/TSLPB GitHub Wiki
Overview
This API returns the process from the specified sensor as a double-precision floating point value in the appropriate units for the sensor.
double TSLPB::readDigitalSensor(TSLPB_DigitalSensor_t sensorName)
Returns
double
a value in the appropriate units for the sensor as a double precision floating point value.
Arguments
sensorName : TSLPB_DigitalSensor_t Sensor Name enum
TSLPB_DigitalSensor_t is an enum of all the built-in digital sensors on the TSLPB
typedef enum
{
DT1, ///< Select LM75A DT1
DT2, ///< Select LM75A DT2
DT3, ///< Select LM75A DT3
DT4, ///< Select LM75A DT4
DT5, ///< Select LM75A DT5
DT6, ///< Select LM75A DT6
Accelerometer_x, ///< Select MPU-9250 Accelerometer x-axis
Accelerometer_y, ///< Select MPU-9250 Accelerometer y-axis
Accelerometer_z, ///< Select MPU-9250 Accelerometer z-axis
Gyroscope_x, ///< Select MPU-9250 Gyroscope x-axis
Gyroscope_y, ///< Select MPU-9250 Gyroscope y-axis
Gyroscope_z, ///< Select MPU-9250 Gyroscope z-axis
Magnetometer_x, ///< Select MPU-9250 Magnetometer x-axis
Magnetometer_y, ///< Select MPU-9250 Magnetometer y-axis
Magnetometer_z, ///< Select MPU-9250 Magnetometer z-axis
IMU_Internal_Temp ///< Select MPU-9250 Internal Temperature
} TSLPB_DigitalSensor_t;
Usage
TSLPB tslpb;
double gyroX = tslpb.readDigitalSensor(Gyroscope_x);