Adafruit Unified Sensor Library
Public Member Functions | List of all members
Adafruit_Sensor Class Referenceabstract

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. More...

#include <Adafruit_Sensor.h>

Public Member Functions

virtual void enableAutoRange (bool enabled)
 Whether we should automatically change the range (if possible) for higher precision. More...
 
virtual bool getEvent (sensors_event_t *)=0
 Get the latest sensor event. More...
 
virtual void getSensor (sensor_t *)=0
 Get info about the sensor itself.
 
void printSensorDetails (void)
 Prints sensor information to serial console.
 

Detailed Description

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.

Member Function Documentation

◆ enableAutoRange()

virtual void Adafruit_Sensor::enableAutoRange ( bool  enabled)
inlinevirtual

Whether we should automatically change the range (if possible) for higher precision.

Parameters
enabledTrue if we will try to autorange

◆ getEvent()

virtual bool Adafruit_Sensor::getEvent ( sensors_event_t )
pure virtual

Get the latest sensor event.

Returns
True if able to fetch an event

The documentation for this class was generated from the following files: