mirror of
https://github.com/adafruit/Adafruit_TSL2561.git
synced 2025-07-31 01:17:14 +02:00
This commit is contained in:
@ -76,7 +76,7 @@ Adafruit_TSL2561_Unified::Adafruit_TSL2561_Unified(uint8_t addr, int32_t sensorI
|
|||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
boolean Adafruit_TSL2561_Unified::begin()
|
boolean Adafruit_TSL2561_Unified::begin()
|
||||||
{
|
{
|
||||||
wire = &Wire;
|
_i2c = &Wire;
|
||||||
_i2c->begin();
|
_i2c->begin();
|
||||||
return init();
|
return init();
|
||||||
}
|
}
|
||||||
@ -91,7 +91,7 @@ boolean Adafruit_TSL2561_Unified::begin()
|
|||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
boolean Adafruit_TSL2561_Unified::begin(TwoWire *theWire)
|
boolean Adafruit_TSL2561_Unified::begin(TwoWire *theWire)
|
||||||
{
|
{
|
||||||
wire = theWire;
|
_i2c = theWire;
|
||||||
_i2c-> begin();
|
_i2c-> begin();
|
||||||
return init();
|
return init();
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
#define TSL2561_BLOCK_BIT (0x10) ///< 1 = using block read/write
|
#define TSL2561_BLOCK_BIT (0x10) ///< 1 = using block read/write
|
||||||
|
|
||||||
#define TSL2561_CONTROL_POWERON (0x03) ///< Control register setting to turn on
|
#define TSL2561_CONTROL_POWERON (0x03) ///< Control register setting to turn on
|
||||||
#define TSL2561_CONTROL_POWEROFF (0x00)) ///< Control register setting to turn off
|
#define TSL2561_CONTROL_POWEROFF (0x00) ///< Control register setting to turn off
|
||||||
|
|
||||||
#define TSL2561_LUX_LUXSCALE (14) ///< Scale by 2^14
|
#define TSL2561_LUX_LUXSCALE (14) ///< Scale by 2^14
|
||||||
#define TSL2561_LUX_RATIOSCALE (9) ///< Scale ratio by 2^9
|
#define TSL2561_LUX_RATIOSCALE (9) ///< Scale ratio by 2^9
|
||||||
@ -194,7 +194,7 @@ class Adafruit_TSL2561_Unified : public Adafruit_Sensor {
|
|||||||
|
|
||||||
void enable (void);
|
void enable (void);
|
||||||
void disable (void);
|
void disable (void);
|
||||||
void write8 (uint8_t reg, uint32_t value);
|
void write8 (uint8_t reg, uint8_t value);
|
||||||
uint8_t read8 (uint8_t reg);
|
uint8_t read8 (uint8_t reg);
|
||||||
uint16_t read16 (uint8_t reg);
|
uint16_t read16 (uint8_t reg);
|
||||||
void getData (uint16_t *broadband, uint16_t *ir);
|
void getData (uint16_t *broadband, uint16_t *ir);
|
||||||
|
Reference in New Issue
Block a user