Characteristic Locus
Inheritance object ObservableBase<UNIT> SamplingSensorBase<UNIT> > PollingSensorBase<UNIT> > ByteCommsSensorBase<UNIT> > Ads1x15Base > Emc2101 > Bmi270 > Bme280 > Bme68x > HC2 > A02yyuw > Me007ys > NextPm > Y4000 > Hx711 > Adxl3xxBase > Lis2Mdl > Lis3mdl > Lsm303agr > Lsm6dsox > SwitchingAnemometer
Implements IObservable<IChangeResult<UNIT>> ISamplingSensor<UNIT> ISensor<UNIT>
Inherited Members SamplingSensorBase<UNIT>.samplingLock SamplingSensorBase<UNIT>.Updated SamplingSensorBase<UNIT>.SamplingTokenSource SamplingSensorBase<UNIT>.Conditions SamplingSensorBase<UNIT>.IsSampling SamplingSensorBase<UNIT>.UpdateInterval SamplingSensorBase<UNIT>.ReadSensor() SamplingSensorBase<UNIT>.RaiseEventsAndNotify(IChangeResult<UNIT>) SamplingSensorBase<UNIT>.Read() ObservableBase<UNIT>.observers ObservableBase<UNIT>.NotifyObservers(IChangeResult<UNIT>) ObservableBase<UNIT>.Subscribe(IObserver<IChangeResult<UNIT>>) ObservableBase<UNIT>.CreateObserver(Action<IChangeResult<UNIT>>, Predicate<IChangeResult<UNIT>>) object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString()
Namespace Meadow.Foundation
Assembly Meadow.Foundation.dll

Syntax

public abstract class PollingSensorBase<UNIT> : SamplingSensorBase<UNIT>, IObservable<IChangeResult<UNIT>>, ISamplingSensor<UNIT>, ISensor<UNIT> where UNIT : struct

Type Parameters

Name Description
UNIT

Methods

StartUpdating(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 override void StartUpdating(TimeSpan? updateInterval = null)

Parameters

Type Name Description
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.

Overrides

StopUpdating()

Stops sampling the sensor

Declaration
public override void StopUpdating()

Overrides