Class SimulatedRangeFinder
Represents a simulated range finder.
Assembly: Meadow.Foundation.dll
View Source
Declaration
public class SimulatedRangeFinder : SimulatedSamplingSensorBase<Length>, ISimulatedSensor, IRangeFinder, ISamplingSensor<Length>, ISensor<Length>, ISensor, ISamplingSensor
Inheritance: System.Object
-> Meadow.Foundation.Sensors.SimulatedSensorBase
Implements:
Meadow.Peripherals.Sensors.ISimulatedSensor
, Meadow.Peripherals.Sensors.Distance.IRangeFinder
, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Length>
, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Length>
, Meadow.Peripherals.Sensors.ISensor
, Meadow.Peripherals.Sensors.ISamplingSensor
Properties
ValueType
Gets the type of the sensor's value.
View Source
Declaration
public override Type ValueType { get; }
Distance
Last value read from the sensor
View Source
Declaration
public Length? Distance { get; protected set; }
Methods
SetSensorValue(object)
Sets the simulated value for the sensor.
View Source
Declaration
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
Declaration
protected override Length GenerateSimulatedValue(SimulationBehavior behavior)
Returns
Meadow.Units.Length
Parameters
Type | Name | Description |
---|---|---|
Meadow.Peripherals.Sensors.SimulationBehavior | behavior | The behavior to use when generating a value |
MeasureDistance()
Sends a trigger signal
View Source
Declaration
public void MeasureDistance()
Implements
Meadow.Peripherals.Sensors.ISimulatedSensor
Meadow.Peripherals.Sensors.Distance.IRangeFinder
Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Length>
Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Length>
Meadow.Peripherals.Sensors.ISensor
Meadow.Peripherals.Sensors.ISamplingSensor