Remarks

PollingPushButton
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation
Characteristic Locus
Inheritance object PushButtonBase > PollingPushButton
Implements IButton ISensor<bool> IDisposable
Inherited Members PushButtonBase.DefaultLongPressThreshold PushButtonBase.PressStarted PushButtonBase.PressEnded PushButtonBase.Clicked PushButtonBase.LongClicked PushButtonBase.ShouldDisposeInput PushButtonBase.ButtonPressStart PushButtonBase.DigitalIn PushButtonBase.LongClickedThreshold PushButtonBase.State PushButtonBase.GetNormalizedState(bool) PushButtonBase.UpdateEvents(bool) PushButtonBase.RaiseClicked() PushButtonBase.RaisePressStarted() PushButtonBase.RaisePressEnded() PushButtonBase.RaiseLongClicked() PushButtonBase.Read() object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString()
Namespace Meadow.Foundation.Sensors.Buttons
Assembly Meadow.Foundation.dll

Syntax

public class PollingPushButton : PushButtonBase, IButton, ISensor<bool>, IDisposable

Constructors

PollingPushButton(IDigitalInputPort, ResistorMode)

Creates PushButton with a pre-configured input port

Declaration
public PollingPushButton(IDigitalInputPort inputPort, ResistorMode resistorMode = ResistorMode.InternalPullUp)

Parameters

Type Name Description
IDigitalInputPort inputPort

The input port connected to the button

ResistorMode resistorMode

The resistor mode

Remarks

PollingPushButton
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation

PollingPushButton(IPin, ResistorMode)

Creates PushButton with an input pin

Declaration
public PollingPushButton(IPin inputPin, ResistorMode resistorMode = ResistorMode.InternalPullUp)

Parameters

Type Name Description
IPin inputPin

The pin connected to the button

ResistorMode resistorMode

The resistor mode

Remarks

PollingPushButton
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation

Fields

ctsPolling

Cancellation token source to disable button polling on dispose

Declaration
protected CancellationTokenSource? ctsPolling

Field Value

Type Description
CancellationTokenSource

Remarks

PollingPushButton
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation

Properties

ButtonPollingInterval

The button state polling interval for PushButton instances that are created from a port that doesn't have an interrupt mode of EdgeBoth - otherwise ignored

Declaration
public TimeSpan ButtonPollingInterval { get; set; }

Property Value

Type Description
TimeSpan

Remarks

PollingPushButton
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public override void Dispose()

Overrides

Remarks

PollingPushButton
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation