Package com.tinkerforge
Class BrickletTemperatureIR
- java.lang.Object
-
- com.tinkerforge.DeviceBase
-
- com.tinkerforge.Device
-
- com.tinkerforge.BrickletTemperatureIR
-
public class BrickletTemperatureIR extends Device
Measures contactless object temperature between -70°C and +380°C
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
BrickletTemperatureIR.AmbientTemperatureCallbackThreshold
static interface
BrickletTemperatureIR.AmbientTemperatureListener
This listener is triggered periodically with the period that is set bysetAmbientTemperatureCallbackPeriod(long)
.static interface
BrickletTemperatureIR.AmbientTemperatureReachedListener
This listener is triggered when the threshold as set bysetAmbientTemperatureCallbackThreshold(char, short, short)
is reached.class
BrickletTemperatureIR.ObjectTemperatureCallbackThreshold
static interface
BrickletTemperatureIR.ObjectTemperatureListener
This listener is triggered periodically with the period that is set bysetObjectTemperatureCallbackPeriod(long)
.static interface
BrickletTemperatureIR.ObjectTemperatureReachedListener
This listener is triggered when the threshold as set bysetObjectTemperatureCallbackThreshold(char, short, short)
is reached.-
Nested classes/interfaces inherited from class com.tinkerforge.Device
Device.Identity
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description BrickletTemperatureIR(java.lang.String uid, IPConnection ipcon)
Creates an object with the unique device ID \c uid.
-
Method Summary
-
Methods inherited from class com.tinkerforge.DeviceBase
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
-
-
-
-
Field Detail
-
DEVICE_IDENTIFIER
public static final int DEVICE_IDENTIFIER
- See Also:
- Constant Field Values
-
DEVICE_DISPLAY_NAME
public static final java.lang.String DEVICE_DISPLAY_NAME
- See Also:
- Constant Field Values
-
FUNCTION_GET_AMBIENT_TEMPERATURE
public static final byte FUNCTION_GET_AMBIENT_TEMPERATURE
- See Also:
- Constant Field Values
-
FUNCTION_GET_OBJECT_TEMPERATURE
public static final byte FUNCTION_GET_OBJECT_TEMPERATURE
- See Also:
- Constant Field Values
-
FUNCTION_SET_EMISSIVITY
public static final byte FUNCTION_SET_EMISSIVITY
- See Also:
- Constant Field Values
-
FUNCTION_GET_EMISSIVITY
public static final byte FUNCTION_GET_EMISSIVITY
- See Also:
- Constant Field Values
-
FUNCTION_SET_AMBIENT_TEMPERATURE_CALLBACK_PERIOD
public static final byte FUNCTION_SET_AMBIENT_TEMPERATURE_CALLBACK_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_GET_AMBIENT_TEMPERATURE_CALLBACK_PERIOD
public static final byte FUNCTION_GET_AMBIENT_TEMPERATURE_CALLBACK_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_SET_OBJECT_TEMPERATURE_CALLBACK_PERIOD
public static final byte FUNCTION_SET_OBJECT_TEMPERATURE_CALLBACK_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_GET_OBJECT_TEMPERATURE_CALLBACK_PERIOD
public static final byte FUNCTION_GET_OBJECT_TEMPERATURE_CALLBACK_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_SET_AMBIENT_TEMPERATURE_CALLBACK_THRESHOLD
public static final byte FUNCTION_SET_AMBIENT_TEMPERATURE_CALLBACK_THRESHOLD
- See Also:
- Constant Field Values
-
FUNCTION_GET_AMBIENT_TEMPERATURE_CALLBACK_THRESHOLD
public static final byte FUNCTION_GET_AMBIENT_TEMPERATURE_CALLBACK_THRESHOLD
- See Also:
- Constant Field Values
-
FUNCTION_SET_OBJECT_TEMPERATURE_CALLBACK_THRESHOLD
public static final byte FUNCTION_SET_OBJECT_TEMPERATURE_CALLBACK_THRESHOLD
- See Also:
- Constant Field Values
-
FUNCTION_GET_OBJECT_TEMPERATURE_CALLBACK_THRESHOLD
public static final byte FUNCTION_GET_OBJECT_TEMPERATURE_CALLBACK_THRESHOLD
- See Also:
- Constant Field Values
-
FUNCTION_SET_DEBOUNCE_PERIOD
public static final byte FUNCTION_SET_DEBOUNCE_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_GET_DEBOUNCE_PERIOD
public static final byte FUNCTION_GET_DEBOUNCE_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_GET_IDENTITY
public static final byte FUNCTION_GET_IDENTITY
- See Also:
- Constant Field Values
-
THRESHOLD_OPTION_OFF
public static final char THRESHOLD_OPTION_OFF
- See Also:
- Constant Field Values
-
THRESHOLD_OPTION_OUTSIDE
public static final char THRESHOLD_OPTION_OUTSIDE
- See Also:
- Constant Field Values
-
THRESHOLD_OPTION_INSIDE
public static final char THRESHOLD_OPTION_INSIDE
- See Also:
- Constant Field Values
-
THRESHOLD_OPTION_SMALLER
public static final char THRESHOLD_OPTION_SMALLER
- See Also:
- Constant Field Values
-
THRESHOLD_OPTION_GREATER
public static final char THRESHOLD_OPTION_GREATER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BrickletTemperatureIR
public BrickletTemperatureIR(java.lang.String uid, IPConnection ipcon)
Creates an object with the unique device ID \c uid. and adds it to the IP Connection \c ipcon.
-
-
Method Detail
-
getAmbientTemperature
public short getAmbientTemperature() throws TinkerforgeException
Returns the ambient temperature of the sensor. If you want to get the ambient temperature periodically, it is recommended to use theBrickletTemperatureIR.AmbientTemperatureListener
listener and set the period withsetAmbientTemperatureCallbackPeriod(long)
.- Throws:
TinkerforgeException
-
getObjectTemperature
public short getObjectTemperature() throws TinkerforgeException
Returns the object temperature of the sensor, i.e. the temperature of the surface of the object the sensor is aimed at. The temperature of different materials is dependent on their `emissivity <https://en.wikipedia.org/wiki/Emissivity>`__. The emissivity of the material can be set withsetEmissivity(int)
. If you want to get the object temperature periodically, it is recommended to use theBrickletTemperatureIR.ObjectTemperatureListener
listener and set the period withsetObjectTemperatureCallbackPeriod(long)
.- Throws:
TinkerforgeException
-
setEmissivity
public void setEmissivity(int emissivity) throws TinkerforgeException
Sets the `emissivity <https://en.wikipedia.org/wiki/Emissivity>`__ that is used to calculate the surface temperature as returned bygetObjectTemperature()
. The emissivity is usually given as a value between 0.0 and 1.0. A list of emissivities of different materials can be found `here <https://www.infrared-thermography.com/material.htm>`__. The parameter ofsetEmissivity(int)
has to be given with a factor of 65535 (16-bit). For example: An emissivity of 0.1 can be set with the value 6553, an emissivity of 0.5 with the value 32767 and so on. \note If you need a precise measurement for the object temperature, it is absolutely crucial that you also provide a precise emissivity. The emissivity is stored in non-volatile memory and will still be used after a restart or power cycle of the Bricklet.- Throws:
TinkerforgeException
-
getEmissivity
public int getEmissivity() throws TinkerforgeException
Returns the emissivity as set bysetEmissivity(int)
.- Throws:
TinkerforgeException
-
setAmbientTemperatureCallbackPeriod
public void setAmbientTemperatureCallbackPeriod(long period) throws TinkerforgeException
Sets the period with which theBrickletTemperatureIR.AmbientTemperatureListener
listener is triggered periodically. A value of 0 turns the listener off. TheBrickletTemperatureIR.AmbientTemperatureListener
listener is only triggered if the temperature has changed since the last triggering.- Throws:
TinkerforgeException
-
getAmbientTemperatureCallbackPeriod
public long getAmbientTemperatureCallbackPeriod() throws TinkerforgeException
Returns the period as set bysetAmbientTemperatureCallbackPeriod(long)
.- Throws:
TinkerforgeException
-
setObjectTemperatureCallbackPeriod
public void setObjectTemperatureCallbackPeriod(long period) throws TinkerforgeException
Sets the period with which theBrickletTemperatureIR.ObjectTemperatureListener
listener is triggered periodically. A value of 0 turns the listener off. TheBrickletTemperatureIR.ObjectTemperatureListener
listener is only triggered if the temperature has changed since the last triggering.- Throws:
TinkerforgeException
-
getObjectTemperatureCallbackPeriod
public long getObjectTemperatureCallbackPeriod() throws TinkerforgeException
Returns the period as set bysetObjectTemperatureCallbackPeriod(long)
.- Throws:
TinkerforgeException
-
setAmbientTemperatureCallbackThreshold
public void setAmbientTemperatureCallbackThreshold(char option, short min, short max) throws TinkerforgeException
Sets the thresholds for theBrickletTemperatureIR.AmbientTemperatureReachedListener
listener. The following options are possible: \verbatim "Option", "Description" "'x'", "Listener is turned off" "'o'", "Listener is triggered when the ambient temperature is *outside* the min and max values" "'i'", "Listener is triggered when the ambient temperature is *inside* the min and max values" "'<'", "Listener is triggered when the ambient temperature is smaller than the min value (max is ignored)" "'>'", "Listener is triggered when the ambient temperature is greater than the min value (max is ignored)" \endverbatim- Throws:
TinkerforgeException
-
getAmbientTemperatureCallbackThreshold
public BrickletTemperatureIR.AmbientTemperatureCallbackThreshold getAmbientTemperatureCallbackThreshold() throws TinkerforgeException
Returns the threshold as set bysetAmbientTemperatureCallbackThreshold(char, short, short)
.- Throws:
TinkerforgeException
-
setObjectTemperatureCallbackThreshold
public void setObjectTemperatureCallbackThreshold(char option, short min, short max) throws TinkerforgeException
Sets the thresholds for theBrickletTemperatureIR.ObjectTemperatureReachedListener
listener. The following options are possible: \verbatim "Option", "Description" "'x'", "Listener is turned off" "'o'", "Listener is triggered when the object temperature is *outside* the min and max values" "'i'", "Listener is triggered when the object temperature is *inside* the min and max values" "'<'", "Listener is triggered when the object temperature is smaller than the min value (max is ignored)" "'>'", "Listener is triggered when the object temperature is greater than the min value (max is ignored)" \endverbatim- Throws:
TinkerforgeException
-
getObjectTemperatureCallbackThreshold
public BrickletTemperatureIR.ObjectTemperatureCallbackThreshold getObjectTemperatureCallbackThreshold() throws TinkerforgeException
Returns the threshold as set bysetObjectTemperatureCallbackThreshold(char, short, short)
.- Throws:
TinkerforgeException
-
setDebouncePeriod
public void setDebouncePeriod(long debounce) throws TinkerforgeException
Sets the period with which the threshold listeners *BrickletTemperatureIR.AmbientTemperatureReachedListener
, *BrickletTemperatureIR.ObjectTemperatureReachedListener
are triggered, if the thresholds *setAmbientTemperatureCallbackThreshold(char, short, short)
, *setObjectTemperatureCallbackThreshold(char, short, short)
keep being reached.- Throws:
TinkerforgeException
-
getDebouncePeriod
public long getDebouncePeriod() throws TinkerforgeException
Returns the debounce period as set bysetDebouncePeriod(long)
.- Throws:
TinkerforgeException
-
getIdentity
public Device.Identity getIdentity() throws TinkerforgeException
Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier. The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port). A Bricklet connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always at position 'z'. The device identifier numbers can be found :ref:`here <device_identifier>`. |device_identifier_constant|- Specified by:
getIdentity
in classDevice
- Throws:
TinkerforgeException
-
addAmbientTemperatureListener
public void addAmbientTemperatureListener(BrickletTemperatureIR.AmbientTemperatureListener listener)
Adds a AmbientTemperature listener.
-
removeAmbientTemperatureListener
public void removeAmbientTemperatureListener(BrickletTemperatureIR.AmbientTemperatureListener listener)
Removes a AmbientTemperature listener.
-
addObjectTemperatureListener
public void addObjectTemperatureListener(BrickletTemperatureIR.ObjectTemperatureListener listener)
Adds a ObjectTemperature listener.
-
removeObjectTemperatureListener
public void removeObjectTemperatureListener(BrickletTemperatureIR.ObjectTemperatureListener listener)
Removes a ObjectTemperature listener.
-
addAmbientTemperatureReachedListener
public void addAmbientTemperatureReachedListener(BrickletTemperatureIR.AmbientTemperatureReachedListener listener)
Adds a AmbientTemperatureReached listener.
-
removeAmbientTemperatureReachedListener
public void removeAmbientTemperatureReachedListener(BrickletTemperatureIR.AmbientTemperatureReachedListener listener)
Removes a AmbientTemperatureReached listener.
-
addObjectTemperatureReachedListener
public void addObjectTemperatureReachedListener(BrickletTemperatureIR.ObjectTemperatureReachedListener listener)
Adds a ObjectTemperatureReached listener.
-
removeObjectTemperatureReachedListener
public void removeObjectTemperatureReachedListener(BrickletTemperatureIR.ObjectTemperatureReachedListener listener)
Removes a ObjectTemperatureReached listener.
-
-