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
TSL2561 Class Reference

API for the TSL2561 Digital Light Sensor. More...

Detailed Description

TSL2560 and TSL2561 are light-to-digital converters that transform light intensity to a digital signal output capable of a direct I2C (TSL2561) interface

tsl2561.jpg
if (argc < 2) {
printf("Provide loop count \n");
} else {
loopCount = atoi(argv[1]);
}
sensor = new upm::TSL2561();
for(int i=0; i< loopCount; i++){
fprintf(stdout, "Lux = %d\n", sensor->getLux());
}

Public Member Functions

 TSL2561 (int bus=0, uint8_t devAddr=TSL2561_Address, uint8_t gain=GAIN_0X, uint8_t integrationTime=INTEGRATION_TIME1_101MS)
 
 ~TSL2561 ()
 
int getLux ()
 

Constructor & Destructor Documentation

TSL2561 ( int  bus = 0,
uint8_t  devAddr = TSL2561_Address,
uint8_t  gain = GAIN_0X,
uint8_t  integrationTime = INTEGRATION_TIME1_101MS 
)

Instantiates a TSL2561 object

Parameters
busNumber of the used bus
devAddrAddress of the used I2C device
gainCorrect gain to use
integrationTime to use
~TSL2561 ( )

GY65 object destructor; powers down TSL2561 and closes the I2C connection.

Member Function Documentation

int getLux ( )

Gets the calculated lux reading from TSL2561

Returns
Calculated lux value from the sensor

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