Characteristic Locus
Inheritance System.Object > SFSR02
Namespace Meadow.Foundation.Sensors.Distance
Assembly SFSR02.dll

Syntax

public class SFSR02 : IRangeFinder

Constructors

View Source

SFSR02(IBiDirectionalPort)

Create a new SFSR02 object

Declaration
public SFSR02(IBiDirectionalPort triggerEchoPort)

Parameters

Type Name Description
IBiDirectionalPort triggerEchoPort
View Source

SFSR02(IIODevice, IPin)

Create a new SFSR02 object with an IO Device

Declaration
public SFSR02(IIODevice device, IPin triggerEchoPin)

Parameters

Type Name Description
IIODevice device
IPin triggerEchoPin

Fields

View Source

tickStart

Declaration
protected long tickStart

Field Value

Type Description
System.Int64
View Source

triggerEchoPort

Trigger/Echo Pin

Declaration
protected IBiDirectionalPort triggerEchoPort

Field Value

Type Description
IBiDirectionalPort

Properties

View Source

CurrentDistance

Returns current distance detected in cm.

Declaration
public float CurrentDistance { get; }

Property Value

Type Description
System.Single
View Source

MaximumDistance

Maximum valid distance in cm (CurrentDistance returns -1 if above).

Declaration
public float MaximumDistance { get; }

Property Value

Type Description
System.Single
View Source

MinimumDistance

Minimum valid distance in cm (CurrentDistance returns -1 if below).

Declaration
public float MinimumDistance { get; }

Property Value

Type Description
System.Single

Methods

View Source

MeasureDistance()

Sends a trigger signal

Declaration
public void MeasureDistance()

Events

View Source

DistanceDetected

Raised when an received a rebound trigger signal

Declaration
public event EventHandler<DistanceEventArgs> DistanceDetected

Event Type

Type Description
System.EventHandler<DistanceEventArgs>