Characteristic Locus
Inheritance System.Object ObservableBase<Length> SensorBase<Length> > SwitchingRainGauge
Inherited Members SensorBase<Length>.Updated SensorBase<Length>.samplingLock SensorBase<Length>.SamplingTokenSource SensorBase<Length>.Conditions SensorBase<Length>.IsSampling SensorBase<Length>.UpdateInterval SensorBase<Length>.RaiseEventsAndNotify(IChangeResult<>) SensorBase<Length>.Read() ObservableBase<Length>.observers ObservableBase<Length>.NotifyObservers(IChangeResult<>) Meadow.Foundation.ObservableBase<Length>.Subscribe(IObserver<>) Meadow.Foundation.ObservableBase<Length>.CreateObserver(Action<>, System.Nullable<Predicate<IChangeResult<UNIT>>>)
Namespace Meadow.Foundation.Sensors.Weather
Assembly RainGauge.dll

Syntax

public class SwitchingRainGauge : SensorBase<Length>

Constructors

SwitchingRainGauge(IDigitalInputController, IPin)

Create a new SwitchingRainGauge object with a default depth of 0.2794 per click

Declaration
public SwitchingRainGauge(IDigitalInputController device, IPin rainSensorPin)

Parameters

Type Name Description
IDigitalInputController device

The device connected to the sensor

IPin rainSensorPin

The rain sensor pin

SwitchingRainGauge(IDigitalInputController, IPin, Length)

Create a new SwitchingRainGauge object

Declaration
public SwitchingRainGauge(IDigitalInputController device, IPin rainSensorPin, Length depthPerClick)

Parameters

Type Name Description
IDigitalInputController device

The device connected to the sensor

IPin rainSensorPin

The rain sensor pin

Length depthPerClick

The depth per click

SwitchingRainGauge(IDigitalInputPort, Length)

Create a new SwitchingRainGauge object

Declaration
public SwitchingRainGauge(IDigitalInputPort rainSensorPort, Length depthPerClick)

Parameters

Type Name Description
IDigitalInputPort rainSensorPort

The port for the rain sensor pin

Length depthPerClick

The depth per click

Properties

ClickCount

The number of times the rain tilt sensor has triggered This count is multiplied by the depth per click to calculate the rain depth

Declaration
public int ClickCount { get; protected set; }

Property Value

Type Description
System.Int32

DepthPerClick

The amount of rain recorded per raingauge event

Declaration
public Length DepthPerClick { get; set; }

Property Value

Type Description
Length

RainDepth

The total accumulated rain depth

Declaration
public Length RainDepth { get; }

Property Value

Type Description
Length

Methods

ReadSensor()

Convenience method to get the current rain depth

Declaration
protected override Task<Length> ReadSensor()

Returns

Type Description
Task<Length>

Overrides

Meadow.Foundation.SensorBase<Length>.ReadSensor()

Reset()

Reset the rain height

Declaration
public void Reset()

StartUpdating()

Start the sensor

Declaration
public void StartUpdating()

StopUpdating()

Stops sampling the sensor

Declaration
public void StopUpdating()