public class TemperatureSensor extends Sensor
| Constructor and Description |
|---|
TemperatureSensor()
Creates a sensor instance connected to port S1.
|
TemperatureSensor(SensorPort port)
Creates a sensor instance connected to the given port.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getTemperature()
Returns the temperature in degrees Celsius rounded to two decimals.
|
public TemperatureSensor(SensorPort port)
port - the port where the sensor is plugged-inpublic TemperatureSensor()