mirror of
https://github.com/adafruit/Adafruit_TSL2561.git
synced 2025-07-31 17:34:29 +02:00
Extended delays to take into account loose timing with 'delay'
This commit is contained in:
@@ -29,6 +29,10 @@
|
|||||||
|
|
||||||
#include "Adafruit_TSL2561_U.h"
|
#include "Adafruit_TSL2561_U.h"
|
||||||
|
|
||||||
|
#define TSL2561_DELAY_INTTIME_13MS (15)
|
||||||
|
#define TSL2561_DELAY_INTTIME_101MS (120)
|
||||||
|
#define TSL2561_DELAY_INTTIME_402MS (450)
|
||||||
|
|
||||||
/*========================================================================*/
|
/*========================================================================*/
|
||||||
/* PRIVATE FUNCTIONS */
|
/* PRIVATE FUNCTIONS */
|
||||||
/*========================================================================*/
|
/*========================================================================*/
|
||||||
@@ -140,13 +144,13 @@ void Adafruit_TSL2561_Unified::getData (uint16_t *broadband, uint16_t *ir)
|
|||||||
switch (_tsl2561IntegrationTime)
|
switch (_tsl2561IntegrationTime)
|
||||||
{
|
{
|
||||||
case TSL2561_INTEGRATIONTIME_13MS:
|
case TSL2561_INTEGRATIONTIME_13MS:
|
||||||
delay(14);
|
delay(TSL2561_DELAY_INTTIME_13MS); // KTOWN: Was 14ms
|
||||||
break;
|
break;
|
||||||
case TSL2561_INTEGRATIONTIME_101MS:
|
case TSL2561_INTEGRATIONTIME_101MS:
|
||||||
delay(102);
|
delay(TSL2561_DELAY_INTTIME_101MS); // KTOWN: Was 102ms
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
delay(403);
|
delay(TSL2561_DELAY_INTTIME_402MS); // KTOWN: Was 403ms
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user