Remarks

Touch
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Grove.Sensors.Buttons.Touch

Code Example

Touch touch;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    touch = new Touch(Device.Pins.D04);
    touch.LongClickedThreshold = TimeSpan.FromMilliseconds(1500);

    touch.Clicked += (s, e) =>
    {
        Resolver.Log.Info("Grove Touch pressed");
    };

    touch.LongClicked += (s, e) =>
    {
        Resolver.Log.Info("Grove Touch long pressed");
    };

    return Task.CompletedTask;
}

Sample project(s) available on GitHub

Wiring Example

Touch Meadow Pin
GND GND
VCC 3.3V
RX D01
TX D00
Characteristic Locus
Inheritance object PushButtonBase PushButton > Touch
Implements IButton ISensor<bool> IDisposable
Inherited Members PushButton.DefaultDebounceDuration PushButton.DefaultGlitchDuration PushButton.DebounceDuration PushButton.DigitalIn PushButtonBase.DefaultLongPressThreshold PushButtonBase.PressStarted PushButtonBase.PressEnded PushButtonBase.Clicked PushButtonBase.LongClicked PushButtonBase.ShouldDisposeInput PushButtonBase.ButtonPressStart PushButtonBase.LongClickedThreshold PushButtonBase.State PushButtonBase.GetNormalizedState(bool) PushButtonBase.UpdateEvents(bool) PushButtonBase.RaiseClicked() PushButtonBase.RaisePressStarted() PushButtonBase.RaisePressEnded() PushButtonBase.RaiseLongClicked() PushButtonBase.Read() PushButtonBase.Dispose() object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString()
Namespace Meadow.Foundation.Grove.Sensors.Buttons
Assembly Touch.dll

Syntax

public class Touch : PushButton, IButton, ISensor<bool>, IDisposable

Constructors

Touch(IPin)

Creates a Touch button driver

Declaration
public Touch(IPin inputPin)

Parameters

Type Name Description
IPin inputPin

Remarks

Touch
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Grove.Sensors.Buttons.Touch

Code Example

Touch touch;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    touch = new Touch(Device.Pins.D04);
    touch.LongClickedThreshold = TimeSpan.FromMilliseconds(1500);

    touch.Clicked += (s, e) =>
    {
        Resolver.Log.Info("Grove Touch pressed");
    };

    touch.LongClicked += (s, e) =>
    {
        Resolver.Log.Info("Grove Touch long pressed");
    };

    return Task.CompletedTask;
}

Sample project(s) available on GitHub

Wiring Example

Touch Meadow Pin
GND GND
VCC 3.3V
RX D01
TX D00