Package crackers.kobots.devices.sensors
Class VL6180X
-
- All Implemented Interfaces:
-
com.diozero.api.DeviceInterface
,com.diozero.devices.DistanceSensorInterface
,com.diozero.devices.LuminositySensorInterface
,com.diozero.devices.SensorInterface
,java.lang.AutoCloseable
public final class VL6180X implements LuminositySensorInterface, DistanceSensorInterface
Close-range "time of flight" proximity sensor on an I2C board, works for ranges < 200 mm.
Shamelessly cribbed from the Adafruit CircuitPython driver at https://github.com/adafruit/Adafruit_CircuitPython_VL6180X/blob/main/adafruit_vl6180x.py
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
VL6180X.Companion
-
Field Summary
Fields Modifier and Type Field Description public final static Byte
DEVICE_ID
public final static Integer
DEFAULT_I2C_ADDR
private final Boolean
continuousModeEnabled
private final Integer
range
private final List<Integer>
rangeFromHistory
private final Boolean
rangeHistoryEnabled
public final static VL6180X.Companion
Companion
-
Method Summary
Modifier and Type Method Description final Boolean
getContinuousModeEnabled()
final Integer
getRange()
final List<Integer>
getRangeFromHistory()
final Boolean
getRangeHistoryEnabled()
Unit
close()
Float
getDistanceCm()
Float
getLuminosity()
final Float
getLuminosity(VL6180X.Companion.ALSGain gain)
final Unit
stopContinuousMode()
Stops continuous ranging mode. final Unit
startContinuousMode(Integer period)
Starts continuous ranging mode. -
-
Method Detail
-
getContinuousModeEnabled
final Boolean getContinuousModeEnabled()
-
getRangeFromHistory
final List<Integer> getRangeFromHistory()
-
getRangeHistoryEnabled
final Boolean getRangeHistoryEnabled()
-
getDistanceCm
Float getDistanceCm()
-
getLuminosity
Float getLuminosity()
-
getLuminosity
final Float getLuminosity(VL6180X.Companion.ALSGain gain)
-
stopContinuousMode
final Unit stopContinuousMode()
Stops continuous ranging mode.
-
startContinuousMode
final Unit startContinuousMode(Integer period)
Starts continuous ranging mode. The period is the time delay between measurements, in milliseconds; the value will be floored to the nearest 10 milliseconds (setting to 157 ms sets it to 150 ms). Range is 10 - 2550 ms.
-
-
-
-