Class TemperatureTransmitter
Emulates a temperature sensor that outputs a 4-20mA or 0-20mA current loop signal proportional to the measured temperature within a specified range
Assembly: CurrentLoop.dll
View Source
public class TemperatureTransmitter : CurrentLoopSensor
Inheritance: System.Object -> Meadow.Foundation.CurrentLoop.CurrentLoopSensor
Properties
MinimumSenseTemp
Gets the minimum temperature that this sensor can measure
View Source
public Temperature MinimumSenseTemp { get; }
MaximumSenseTemp
Gets the maximum temperature that this sensor can measure
View Source
public Temperature MaximumSenseTemp { get; }
Methods
SetTemperature(Temperature)
Sets the sensor temperature and outputs the corresponding current loop signal. The output current is linearly interpolated between the sensor's current range based on where the temperature falls within the sensor's measurement range.
View Source
public Task SetTemperature(Temperature temperature)
Returns
System.Threading.Tasks.Task: A task representing the asynchronous operation
Parameters
| Type | Name | Description |
|---|---|---|
Meadow.Units.Temperature | temperature | The temperature to simulate |
Exceptions
System.ArgumentOutOfRangeException
Thrown when temperature is outside the sensor's minimum and maximum range
GetCurrentTemperature()
Gets the current temperature based on the last output current. This method performs the reverse calculation of SetTemperature, converting the current loop signal back to the corresponding temperature value.
View Source
public Temperature GetCurrentTemperature()
Returns
Meadow.Units.Temperature: The temperature corresponding to the current output current