|
SunSPOT API V6.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.spot.resources.Resource
com.sun.spot.sensorboard.io.ScalarInput
com.sun.spot.sensorboard.peripheral.TemperatureInput
public class TemperatureInput
Simple temperature sensor.
| Field Summary | |
|---|---|
protected Hashtable |
thIsolates
|
protected Vector |
thListeners
|
| Fields inherited from class com.sun.spot.sensorboard.io.ScalarInput |
|---|
index, myController, range |
| Fields inherited from interface com.sun.spot.sensorboard.peripheral.ITemperatureInput |
|---|
CELSIUS, FAHRENHEIT |
| Constructor Summary | |
|---|---|
TemperatureInput(PinDescriptor pidx,
int r,
IADCController cntrl)
Creates a new instance of TemperatureInput |
|
| Method Summary | |
|---|---|
void |
addIADT7411TemperatureInputThresholdListener(IADT7411TemperatureInputThresholdListener who)
Add an ILIS3L02AQAccelerometerThresholdListener to the list of callbacks. |
void |
addITemperatureInputThresholdListener(ITemperatureInputThresholdListener who)
Adds the specified temperature sensor threshold listener to receive callbacks from this temperature sensor. |
double |
convert(double val,
boolean toCelsius)
Deprecated. use convertF2C() & convertC2F instead |
double |
convertC2F(double val)
Convert from Celsius to Fahrenheit. |
double |
convertF2C(double val)
Convert from Fahrenheit to Celsius. |
SensorEvent |
createSensorEvent()
Create a SensorEvent of the appropriate type for this sensor. |
double |
getAccuracy()
Returns the accuracy of the sensor (in the current measurement range) as a percentage of reading (=data value). |
double |
getCelsius()
Return the current temperature in degrees Celsius. |
String |
getDescription()
This method returns a readable description of the sensor. |
double |
getFahrenheit()
Return the current temperature in degrees Fahrenheit. |
double |
getHighThreshold(boolean toCelsius)
Return the current high threshold value. |
IADT7411TemperatureInputThresholdListener[] |
getIADT7411TemperatureInputThresholdListeners()
Return all of the IADT7411ThresholdListener callbacks. |
ITemperatureInputThresholdListener[] |
getITemperatureInputThresholdListeners()
Returns an array of all the temperature sensor threshold listeners registered on this temperature sensor. |
double |
getLowThreshold(boolean toCelsius)
Return the current low threshold value. |
double |
getMaxSamplingRate()
Return the maximum sampling rate per second for this sensor. |
double |
getMaxValue()
Returns the current maximum value of the sensor (in the current measurement range). |
double |
getMinValue()
Returns the current minimum value of the sensor (in the current measurement range). |
double |
getResolution()
Returns the resolution of the range (in the current measurement range). |
void |
removeIADT7411TemperatureInputThresholdListener(IADT7411TemperatureInputThresholdListener who)
Remove an IADT7411ThresholdListener from the list of callbacks. |
void |
removeITemperatureInputThresholdListener(ITemperatureInputThresholdListener who)
Removes the specified temperature sensor threshold listener so that it no longer receives callbacks from this temperature sensor. |
void |
saveEventState(SensorEvent evt)
Save the current sensor state in the specified event. |
void |
setThresholds(double low,
double high,
boolean inCelsius)
Set the low and high threshold values for this temperature sensor. |
void |
thresholdChanged(int low,
int high)
Called by pin's IADCController when pin threshold values are changed. |
void |
thresholdExceeded(int val)
Callback from EDemoBoard interrupt handler for threshold event. |
| Methods inherited from class com.sun.spot.sensorboard.io.ScalarInput |
|---|
addIADT7411ThresholdListener, addIScalarInputThresholdListener, areThresholdEventsEnabled, enableThresholdEvents, getHighThreshold, getIADT7411ThresholdListeners, getIndex, getIScalarInputThresholdListeners, getLowThreshold, getRange, getValue, getVoltage, removeIADT7411ThresholdListener, removeIScalarInputThresholdListener, setThresholds, supportsThresholdEvents, toString |
| Methods inherited from class com.sun.spot.resources.Resource |
|---|
addTag, getTags, getTagValue, hasTag, removeTag |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.sun.spot.sensorboard.io.IScalarInput |
|---|
addIScalarInputThresholdListener, areThresholdEventsEnabled, enableThresholdEvents, getHighThreshold, getIndex, getIScalarInputThresholdListeners, getLowThreshold, getRange, getValue, removeIScalarInputThresholdListener, setThresholds, supportsThresholdEvents |
| Methods inherited from interface com.sun.spot.resources.IResource |
|---|
addTag, getTags, getTagValue, hasTag, removeTag |
| Methods inherited from interface com.sun.spot.resources.IResource |
|---|
addTag, getTags, getTagValue, hasTag, removeTag |
| Field Detail |
|---|
protected Vector thListeners
protected Hashtable thIsolates
| Constructor Detail |
|---|
public TemperatureInput(PinDescriptor pidx,
int r,
IADCController cntrl)
pidx - PinDescriptor that the temperature sensor is connected tor - Range of the mask for the above pincntrl - the ADC controller to use| Method Detail |
|---|
public double convertC2F(double val)
convertC2F in interface ITemperatureInputval - Celsius value to convert
public double convertF2C(double val)
convertF2C in interface ITemperatureInputval - Fahrenheit value to convert
public double convert(double val,
boolean toCelsius)
val - value to converttoCelsius - if true convert value from Fahrenheit to Celsius,
if false convert value from Celsius to Fahrenheit
public double getCelsius()
throws IOException
getCelsius in interface ITemperatureInputIOException
public double getFahrenheit()
throws IOException
getFahrenheit in interface ITemperatureInputIOException
public void setThresholds(double low,
double high,
boolean inCelsius)
low - the new low threshold valuehigh - the new high threshold valueinCelsius - true if the new thresholds are in degrees Celsius
public void thresholdChanged(int low,
int high)
thresholdChanged in class ScalarInputlow - the new low threshold value.high - the new high threshold value.public double getLowThreshold(boolean toCelsius)
toCelsius - if true report the low threshold in degrees Celsius
public double getHighThreshold(boolean toCelsius)
toCelsius - if true report the high threshold in degrees Celsius
public void addIADT7411TemperatureInputThresholdListener(IADT7411TemperatureInputThresholdListener who)
who - the ILIS3L02AQAccelerometerThresholdListener to addpublic void removeIADT7411TemperatureInputThresholdListener(IADT7411TemperatureInputThresholdListener who)
who - the IADT7411ThresholdListener to removepublic IADT7411TemperatureInputThresholdListener[] getIADT7411TemperatureInputThresholdListeners()
public void addITemperatureInputThresholdListener(ITemperatureInputThresholdListener who)
who - the temperature sensor threshold listener to add.public void removeITemperatureInputThresholdListener(ITemperatureInputThresholdListener who)
who - the temperature sensor threshold listener to remove.public ITemperatureInputThresholdListener[] getITemperatureInputThresholdListeners()
public void thresholdExceeded(int val)
thresholdExceeded in class ScalarInputval - temperature sensor value taken after event triggeredpublic String getDescription()
ITransducer
getDescription in interface ITransducergetDescription in class ScalarInputpublic double getMaxSamplingRate()
ITransducer
getMaxSamplingRate in interface ITransducergetMaxSamplingRate in class ScalarInputpublic double getMinValue()
IMeasurementInfo
getMinValue in interface IMeasurementInfogetMinValue in class ScalarInputpublic double getMaxValue()
IMeasurementInfo
getMaxValue in interface IMeasurementInfogetMaxValue in class ScalarInputpublic double getResolution()
IMeasurementInfo
getResolution in interface IMeasurementInfogetResolution in class ScalarInputpublic double getAccuracy()
IMeasurementInfo
getAccuracy in interface IMeasurementInfogetAccuracy in class ScalarInputpublic SensorEvent createSensorEvent()
ITransducer
createSensorEvent in interface ITransducercreateSensorEvent in class ScalarInputpublic void saveEventState(SensorEvent evt)
ITransducer
saveEventState in interface ITransducersaveEventState in class ScalarInputevt - the event to store the sensor state in
|
SunSPOT API V6.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||