java.lang.Object
com.diozero.devices.BH1750
- All Implemented Interfaces:
DeviceInterface
,LuminositySensorInterface
,SensorInterface
,AutoCloseable
BH1750 Luminosity sensor
Datasheet
Python code
Pins:
+------------------------------+ | BH1750 | |------+-----+-----+-----+-----| | ADDR | SDA | SCL | GND | VCC | +------+-----+-----+-----+-----+
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionBH1750
(int controller) BH1750
(int controller, int address) BH1750
(int controller, int address, BH1750.Mode mode) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close this devicefloat
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
-