upm  0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups Pages
Public Member Functions
APDS9930 Class Reference

APDS9930 Digital Proximity and Ambient Light Sensor. More...

Detailed Description

This sensor provides digital ambient light sensing (ALS), IR LED and a complete proximity detection system.

// Instantiate a Digital Proximity and Ambient Light sensor on iio device 4
upm::APDS9930* light_proximity = new upm::APDS9930(4);
while (shouldRun) {
float lux = light_proximity->getAmbient();
cout << "Luminance value is " << lux << endl;
float proximity = light_proximity->getProximity();
cout << "Proximity value is " << proximity << endl;
sleep(1);
}

Public Member Functions

 APDS9930 (int device)
 
 ~APDS9930 ()
 
int getAmbient ()
 
int getProximity ()
 

Constructor & Destructor Documentation

APDS9930 ( int  device)

APDS-9930 digital proximity and ambient light sensor constructor

Parameters
iiodevice number
~APDS9930 ( )

APDS9930 destructor

Member Function Documentation

int getAmbient ( )

Gets the ambient luminance value from the sensor

Returns
Ambient Luminance value
int getProximity ( )

Gets the proximity value from the sensor

Returns
Proximity value

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