|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--stamp.peripheral.sensor.temperature.TempSensor
TempSensor is an abstract class encapsulating the basic capabilities of a generic temperature sensor, including high and low threshold settings and simple (polled) alarms.
Field Summary | |
static int |
TEMP_HI
|
static int |
TEMP_LO
|
static int |
TEMP_OK
|
Constructor Summary | |
TempSensor()
|
Method Summary | |
int |
CelsiusToFahr(int temp)
Converts Celsius temperature to Fahrenheit |
int |
FahrToCelsius(int temp)
Converts Fahrenheit temperature to Celsius |
int |
getTemp(char tmpUnits)
Returns current temperature. |
abstract int |
getTempC()
|
abstract int |
getTempF()
|
int |
getTempHi(char tmpUnits)
Returns high temperature threshold in specified units |
int |
getTempLo(char tmpUnits)
Returns low temperature threshold in specified units |
abstract int |
getTempRaw()
|
void |
setTempHi(int temp,
char tmpUnits)
Sets high temperature threshold |
void |
setTempLo(int temp,
char tmpUnits)
Sets low temperature threshold |
boolean |
tempHi()
Returns high temperature alarm status. |
boolean |
tempLo()
Returns low temperature alarm status. |
boolean |
tempOk()
Returns temperature alarm status. |
int |
tempStatus()
Returns sensor status: low, okay or high. |
Methods inherited from class java.lang.Object |
equals |
Field Detail |
public static final int TEMP_LO
public static final int TEMP_OK
public static final int TEMP_HI
Constructor Detail |
public TempSensor()
Method Detail |
public abstract int getTempRaw()
public abstract int getTempC()
public abstract int getTempF()
public int getTemp(char tmpUnits)
tmpUnits
- Temperature units (c, C, f or F)public int FahrToCelsius(int temp)
temp
- Fahrenheit temperaturepublic int CelsiusToFahr(int temp)
temp
- Celsius temperaturepublic void setTempLo(int temp, char tmpUnits)
temp
- Low temperature thresholdtmpUnits
- Temperature type (c, C, f or F)public void setTempHi(int temp, char tmpUnits)
temp
- High temperature thresholdtmpUnits
- Temperature type (c, C, f or F)public int getTempLo(char tmpUnits)
tmpUnits
- Temperature type (c, C, f or F)public int getTempHi(char tmpUnits)
tmpUnits
- Temperature type (c, C, f or F)public boolean tempLo()
public boolean tempOk()
public boolean tempHi()
public int tempStatus()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |