Skip to main content

Class SimulatedVoltageSensor

Represents a simulated voltage sensor

Assembly: Meadow.Foundation.dll​
View Source​
Declaration
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​
Declaration
public override Type ValueType { get; }

Voltage​

Last value read from the Voltage sensor.

View Source​
Declaration
public Voltage? Voltage { get; }

Methods​

ReadVoltage()​

Reads the current voltage of the sensor

View Source​
Declaration
public ValueTask<Voltage> ReadVoltage()
Returns​

System.Threading.Tasks.ValueTask<Meadow.Units.Voltage>

SetSensorValue(object)​

Sets the simulated value for the sensor.

View Source​
Declaration
public override void SetSensorValue(object value)
Parameters​
TypeNameDescription
System.ObjectvalueThe value to set for the sensor.

GenerateSimulatedValue(SimulationBehavior)​

Generates a value based on the provided behavior

View Source​
Declaration
protected override Voltage GenerateSimulatedValue(SimulationBehavior behavior)
Returns​

Meadow.Units.Voltage

Parameters​
TypeNameDescription
Meadow.Peripherals.Sensors.SimulationBehaviorbehaviorThe behavior to use when generating a value

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