|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ITemperatureInput
Simple extension of IScalarInput to handle temperature.
Field Summary | |
---|---|
static boolean |
CELSIUS
|
static boolean |
FAHRENHEIT
|
Method Summary | |
---|---|
void |
addITemperatureInputThresholdListener(ITemperatureInputThresholdListener who)
Adds the specified temperature sensor threshold listener to receive callbacks from this temperature sensor. |
double |
convert(double val,
boolean celsius)
Convert between Celsius and Fahrenheit. |
double |
getCelsius()
Return the current temperature in degrees Celsius. |
double |
getFahrenheit()
Return the current temperature in degrees Fahrenheit. |
double |
getHighThreshold(boolean celsius)
Return the current high threshold value. |
ITemperatureInputThresholdListener[] |
getITemperatureInputThresholdListeners()
Returns an array of all the temperature sensor threshold listeners registered on this temperature sensor. |
double |
getLowThreshold(boolean celsius)
Return the current low threshold value. |
void |
removeITemperatureInputThresholdListener(ITemperatureInputThresholdListener who)
Removes the specified temperature sensor threshold listener so that it no longer receives callbacks from this temperature sensor. |
void |
setThresholds(double low,
double high,
boolean celsius)
Set the high and low thresholds for the temperature sensor. |
Methods inherited from interface com.sun.spot.sensorboard.io.IScalarInput |
---|
addIScalarInputThresholdListener, areThresholdEventsEnabled, enableThresholdEvents, getHighThreshold, getIndex, getIScalarInputThresholdListeners, getLowThreshold, getRange, getValue, removeIScalarInputThresholdListener, setThresholds, supportsThresholdEvents |
Field Detail |
---|
static final boolean CELSIUS
static final boolean FAHRENHEIT
Method Detail |
---|
double convert(double val, boolean celsius)
val
- value to convertcelsius
- if true convert value from Fahrenheit to Celsius,
if false convert value from Celsius to Fahrenheit
double getCelsius() throws IOException
IOException
double getFahrenheit() throws IOException
IOException
void setThresholds(double low, double high, boolean celsius)
low
- the new low threshold valuehigh
- the new high threshold valuecelsius
- true if the new thresholds are in degrees Celsiusdouble getLowThreshold(boolean celsius)
celsius
- if true report the low threshold in degrees Celsius
double getHighThreshold(boolean celsius)
celsius
- if true report the high threshold in degrees Celsius
void addITemperatureInputThresholdListener(ITemperatureInputThresholdListener who)
who
- the temperature sensor threshold listener to add.void removeITemperatureInputThresholdListener(ITemperatureInputThresholdListener who)
who
- the temperature sensor threshold listener to remove.ITemperatureInputThresholdListener[] getITemperatureInputThresholdListeners()
|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |