Package com.diozero.devices
Class BH1750
java.lang.Object
com.diozero.devices.BH1750
- All Implemented Interfaces:
DeviceInterface
,LuminositySensorInterface
,SensorInterface
,AutoCloseable
public class BH1750 extends Object implements LuminositySensorInterface
BH1750 Luminosity sensor
Datasheet
Python
code
Pins:
+------------------------------+ | BH1750 | |------+-----+-----+-----+-----| | ADDR | SDA | SCL | GND | VCC | +------+-----+-----+-----+-----+
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BH1750.Mode
-
Constructor Summary
Constructors Constructor Description BH1750(int controller)
BH1750(int controller, int address)
BH1750(int controller, int address, BH1750.Mode mode)
-
Method Summary
Modifier and Type Method Description void
close()
Close this devicefloat
getLuminosity()
BH1750.Mode
getMode()
void
reset()
void
setMode(BH1750.Mode mode)
-
Constructor Details
-
BH1750
public BH1750(int controller) -
BH1750
public BH1750(int controller, int address) -
BH1750
-
-
Method Details
-
close
public void close()Description copied from interface:DeviceInterface
Close this device- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceDeviceInterface
-
getMode
-
setMode
-
reset
public void reset() -
getLuminosity
- Specified by:
getLuminosity
in interfaceLuminositySensorInterface
- Throws:
RuntimeIOException
-