public class TSL2561 extends Object implements Closeable, LuminositySensorInterface
Modifier and Type | Field and Description |
---|---|
static int |
TSL2561_PACKAGE_CS |
static int |
TSL2561_PACKAGE_T_FN_CL |
Constructor and Description |
---|
TSL2561(int tsl2561Package) |
TSL2561(int controllerNumber,
int addressSize,
int clockFreq,
int tsl2561Package) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
float |
getLuminosity()
Converts the raw sensor values to the standard SI lux equivalent.
|
void |
setAutoGain(boolean autoGain)
Enables or disables the auto-gain settings when reading data from the sensor
|
void |
setGain(int gain)
Adjusts the gain on the TSL2561 (adjusts the sensitivity to light)
|
public static final int TSL2561_PACKAGE_CS
public static final int TSL2561_PACKAGE_T_FN_CL
public TSL2561(int tsl2561Package) throws RuntimeIOException
RuntimeIOException
public TSL2561(int controllerNumber, int addressSize, int clockFreq, int tsl2561Package) throws RuntimeIOException
RuntimeIOException
public void setAutoGain(boolean autoGain)
autoGain
- enable/disablepublic void setGain(int gain) throws RuntimeIOException
gain
- gain valueRuntimeIOException
- if an I/O error occurspublic float getLuminosity() throws RuntimeIOException
getLuminosity
in interface LuminositySensorInterface
RuntimeIOException
public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2016 mattjlewis. All rights reserved.