Class SimulatedVoltageSensor
Represents a simulated voltage sensor
Assembly: Meadow.Foundation.dll
View Source
public class SimulatedVoltageSensor : SimulatedSamplingSensorBase<Voltage>, ISimulatedSensor, ISamplingSensor<Voltage>, ISamplingSensor, IVoltageSensor, ISensor<Voltage>, ISensor
Inheritance: System.Object -> Meadow.Foundation.Sensors.SimulatedSensorBase -> Meadow.Foundation.Sensors.SimulatedSamplingSensorBase<UNIT>
Implements:
Meadow.Peripherals.Sensors.ISimulatedSensor, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Voltage>, Meadow.Peripherals.Sensors.ISamplingSensor, Meadow.Peripherals.Sensors.IVoltageSensor, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Voltage>, Meadow.Peripherals.Sensors.ISensor
Properties
ValueType
Gets the type of the sensor's value.
View Source
public override Type ValueType { get; }
Voltage
Last value read from the Voltage sensor.
View Source
public Voltage? Voltage { get; }
Methods
ReadVoltage()
Reads the current voltage of the sensor
View Source
public ValueTask<Voltage> ReadVoltage()
Returns
System.Threading.Tasks.ValueTask<Meadow.Units.Voltage>
SetSensorValue(object)
Sets the simulated value for the sensor.
View Source
public override void SetSensorValue(object value)
Parameters
| Type | Name | Description |
|---|---|---|
System.Object | value | The value to set for the sensor. |
GenerateSimulatedValue(SimulationBehavior)
Generates a value based on the provided behavior
View Source
protected override Voltage GenerateSimulatedValue(SimulationBehavior behavior)
Returns
Meadow.Units.Voltage
Parameters
| Type | Name | Description |
|---|---|---|
Meadow.Peripherals.Sensors.SimulationBehavior | behavior | The behavior to use when generating a value |
Implements
Meadow.Peripherals.Sensors.ISimulatedSensorMeadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Voltage>Meadow.Peripherals.Sensors.ISamplingSensorMeadow.Peripherals.Sensors.IVoltageSensorMeadow.Peripherals.Sensors.ISensor<Meadow.Units.Voltage>Meadow.Peripherals.Sensors.ISensor