upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
API for the Veris TEAMS Temperature Transmitter. More...
The Veris TEAMS temperature sensor provides it's output via a 4-20ma current loop. The supported temperature range is 10C to 35C.
This sensor was developed with a Cooking Hacks (Libelium) 4-channel 4-20ma Arduino interface shield. For this interface, the receiver resistance (rResistor) was specified as 165.0 ohms.
When using a 4-20ma current loop interface which scales the sensors' values to a 0-5vdc range, you can supply 0.0 as the rResistor value in the constructor (default), and it will act just like a normal analog input.
Public Member Functions | |
TEAMS (int tPin, float rResistor=0.0, float aref=TEAMS_DEFAULT_AREF) | |
~TEAMS () | |
void | update () |
float | getTemperature (bool fahrenheit=false) |
bool | isConnected () |
float | getRawMilliamps () |
void | setOffsetMilliamps (float offset) |
Protected Attributes | |
mraa::Aio | m_aioTemp |
TEAMS | ( | int | tPin, |
float | rResistor = 0.0 , |
||
float | aref = TEAMS_DEFAULT_AREF |
||
) |
TEAMS object constructor
tPin | Analog pin to use for temperature. |
rResistor | The receiver resistance in ohms, when using a 4-20ma current loop interface. When specified, this value will be used in computing the current based on the voltage read when scaling the return values. Default is 0.0, for standard scaling based on voltage output rather than current (4-20ma mode). |
aref | The analog reference voltage, default 5.0 |
void update | ( | void | ) |
Read current values from the sensor and update internal stored values. This method must be called prior to querying any values, such as temperature.
float getTemperature | ( | bool | fahrenheit = false | ) |
Get the current temperature. update() must have been called prior to calling this method.
fahrenheit | true to return the temperature in degrees fahrenheit, false to return the temperature in degrees celsius. The default is false (degrees Celsius). |
|
inline |
When using a direct 4-20ma interface (rResistor supplied in the constructor is >0.0), this function will return false when the computed milliamps falls below 4ma, indicating that the sensor is not connected. If rResistor was specified as 0.0 in the constructor, this function will always return true.
|
inline |
When using a direct 4-20ma interface (rResistor supplied in the constructor is >0.0), this function will return the computed milliamps (after the offset has been applied). If rResistor was specified as 0.0 in the constructor, this function will always return 0.0.
|
inline |
Specify an offset in milliamps to be applied to the computed current prior to scaling and conversion. This can be used to 'adjust' the computed value. If rResistor was specified as 0.0 in the constructor, this function will have no effect.
offset | a positive or negative value that will be applied to the computed current measured. |