Characteristic Locus
Inheritance System.Object ObservableBase<UNIT> SensorBase<UNIT> > SamplingSensorBase<UNIT> > ByteCommsSensorBase<UNIT> > Ads1x15 > Emc2101 > Bme280 > Bme68x > Hx711 > Adxl3xxBase > Thermistor > SwitchingAnemometer
Implements ISamplingSensor<UNIT>
Inherited Members SensorBase<UNIT>.Updated SensorBase<UNIT>.samplingLock SensorBase<UNIT>.SamplingTokenSource SensorBase<UNIT>.Conditions SensorBase<UNIT>.IsSampling SensorBase<UNIT>.UpdateInterval SensorBase<UNIT>.ReadSensor() SensorBase<UNIT>.RaiseEventsAndNotify(IChangeResult<UNIT>) SensorBase<UNIT>.Read() ObservableBase<UNIT>.observers ObservableBase<UNIT>.NotifyObservers(IChangeResult<UNIT>) ObservableBase<UNIT>.Subscribe(IObserver<IChangeResult<UNIT>>) ObservableBase<UNIT>.CreateObserver(Action<IChangeResult<UNIT>>, Nullable<Predicate<IChangeResult<UNIT>>>)
Namespace Meadow.Foundation
Assembly Meadow.Foundation.dll

Syntax

public abstract class SamplingSensorBase<UNIT> : SensorBase<UNIT>, ISamplingSensor<UNIT> where UNIT : struct

Type Parameters

Name Description
UNIT

Methods

StartUpdating(Nullable<TimeSpan>)

Starts updating the sensor on the updateInterval frequency specified.

This method also starts raising Updated events and notifying IObservable subscribers. Use the updateInterval parameter to specify how often events and notifications are raised/sent.

Declaration
public virtual void StartUpdating(TimeSpan? updateInterval = null)

Parameters

Type Name Description
System.Nullable<TimeSpan> updateInterval

A TimeSpan that specifies how long to wait between readings. This value influences how often *Updated events are raised and IObservable consumers are notified. The default is 5 seconds.

StopUpdating()

Stops sampling the sensor.

Declaration
public virtual void StopUpdating()