public class OpticalDistanceSensor extends I2CSensor
Constructor and Description |
---|
OpticalDistanceSensor()
Creates a sensor instance connected to port S1.
|
OpticalDistanceSensor(SensorPort port)
Creates a sensor instance connected to the given port.
|
Modifier and Type | Method and Description |
---|---|
int |
getValue()
Returns the distance from the object in millimeters.
|
getData, getData, getLejosI2CSensor, getProductID, getVersion, sendData, sendData, sendData
getLejosPort
public OpticalDistanceSensor(SensorPort port)
port
- the port where the sensor is plugged-inpublic OpticalDistanceSensor()