Common sensor interface to unify various sensors. Intentionally modeled after sensors.h in the Android API: https://github.com/android/platform_hardware_libhardware/blob/master/include/hardware/sensors.h.
Definition: Adafruit_Sensor.h:162
20 #ifndef _ADAFRUIT_SENSOR_H 21 #define _ADAFRUIT_SENSOR_H 33 #define SENSORS_GRAVITY_EARTH (9.80665F) 34 #define SENSORS_GRAVITY_MOON (1.6F) 35 #define SENSORS_GRAVITY_SUN (275.0F) 36 #define SENSORS_GRAVITY_STANDARD (SENSORS_GRAVITY_EARTH) 37 #define SENSORS_MAGFIELD_EARTH_MAX \ 39 #define SENSORS_MAGFIELD_EARTH_MIN \ 41 #define SENSORS_PRESSURE_SEALEVELHPA \ 43 #define SENSORS_DPS_TO_RADS \ 46 #define SENSORS_RADS_TO_DPS \ 48 #define SENSORS_GAUSS_TO_MICROTESLA \ 53 SENSOR_TYPE_ACCELEROMETER = (1),
54 SENSOR_TYPE_MAGNETIC_FIELD = (2),
55 SENSOR_TYPE_ORIENTATION = (3),
56 SENSOR_TYPE_GYROSCOPE = (4),
57 SENSOR_TYPE_LIGHT = (5),
58 SENSOR_TYPE_PRESSURE = (6),
59 SENSOR_TYPE_PROXIMITY = (8),
60 SENSOR_TYPE_GRAVITY = (9),
61 SENSOR_TYPE_LINEAR_ACCELERATION =
63 SENSOR_TYPE_ROTATION_VECTOR = (11),
64 SENSOR_TYPE_RELATIVE_HUMIDITY = (12),
65 SENSOR_TYPE_AMBIENT_TEMPERATURE = (13),
66 SENSOR_TYPE_OBJECT_TEMPERATURE = (14),
67 SENSOR_TYPE_VOLTAGE = (15),
68 SENSOR_TYPE_CURRENT = (16),
69 SENSOR_TYPE_COLOR = (17),
70 SENSOR_TYPE_TVOC = (18)
135 float relative_humidity;
Definition: Adafruit_Sensor.h:75
+
Common sensor interface to unify various sensors. Intentionally modeled after sensors.h in the Android API: https://github.com/android/platform_hardware_libhardware/blob/master/include/hardware/sensors.h.
Definition: Adafruit_Sensor.h:164
virtual bool getEvent(sensors_event_t *)=0
Get the latest sensor event.
void printSensorDetails(void)
Prints sensor information to serial console.
Definition: Adafruit_Sensor.cpp:8
-
Definition: Adafruit_Sensor.h:145
-
Definition: Adafruit_Sensor.h:117
+
Definition: Adafruit_Sensor.h:147
+
Definition: Adafruit_Sensor.h:118
virtual void getSensor(sensor_t *)=0
Get info about the sensor itself.
-
Definition: Adafruit_Sensor.h:101
-
virtual void enableAutoRange(bool enabled)
Whether we should automatically change the range (if possible) for higher precision.
Definition: Adafruit_Sensor.h:173
+
Definition: Adafruit_Sensor.h:102
+
virtual void enableAutoRange(bool enabled)
Whether we should automatically change the range (if possible) for higher precision.
Definition: Adafruit_Sensor.h:175