public class TSL2561 extends Object implements Closeable, LuminositySensorInterface
Modifier and Type | Class and Description |
---|---|
static class |
TSL2561.TSL2561Package |
Constructor and Description |
---|
TSL2561(int controllerNumber,
int addressSize,
int clockFreq,
TSL2561.TSL2561Package tsl2561Package) |
TSL2561(TSL2561.TSL2561Package 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 TSL2561(TSL2561.TSL2561Package tsl2561Package) throws RuntimeIOException
RuntimeIOException
public TSL2561(int controllerNumber, int addressSize, int clockFreq, TSL2561.TSL2561Package 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 SensorInterface
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2016–2018 mattjlewis. All rights reserved.