mirror of
https://github.com/adafruit/Adafruit_TSL2561.git
synced 2025-07-30 17:07:14 +02:00
Added bool return type to getEvent
This commit is contained in:
@ -478,7 +478,7 @@ uint32_t Adafruit_TSL2561_Unified::calculateLux(uint16_t broadband, uint16_t ir)
|
|||||||
@brief Gets the most recent sensor event
|
@brief Gets the most recent sensor event
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
void Adafruit_TSL2561_Unified::getEvent(sensors_event_t *event)
|
bool Adafruit_TSL2561_Unified::getEvent(sensors_event_t *event)
|
||||||
{
|
{
|
||||||
uint16_t broadband, ir;
|
uint16_t broadband, ir;
|
||||||
|
|
||||||
@ -493,6 +493,8 @@ void Adafruit_TSL2561_Unified::getEvent(sensors_event_t *event)
|
|||||||
/* Calculate the actual lux value */
|
/* Calculate the actual lux value */
|
||||||
getLuminosity(&broadband, &ir);
|
getLuminosity(&broadband, &ir);
|
||||||
event->light = calculateLux(broadband, ir);
|
event->light = calculateLux(broadband, ir);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
@ -181,7 +181,7 @@ class Adafruit_TSL2561_Unified : public Adafruit_Sensor {
|
|||||||
uint32_t calculateLux(uint16_t broadband, uint16_t ir);
|
uint32_t calculateLux(uint16_t broadband, uint16_t ir);
|
||||||
|
|
||||||
/* Unified Sensor API Functions */
|
/* Unified Sensor API Functions */
|
||||||
void getEvent(sensors_event_t*);
|
bool getEvent(sensors_event_t*);
|
||||||
void getSensor(sensor_t*);
|
void getSensor(sensor_t*);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Reference in New Issue
Block a user