public class OpticalDistanceSensor extends Sensor
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 |
getDistance()
Returns the distance from the object in millimeters.
|
public OpticalDistanceSensor(SensorPort port)
port
- the port where the sensor is plugged-inpublic OpticalDistanceSensor()