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()
{
    Console.WriteLine("Initialize...");

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

    touch.Clicked += (s, e) =>
    {
        Console.WriteLine("Grove Touch pressed");
    };

    touch.LongClicked += (s, e) =>
    {
        Console.WriteLine("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 System.Object PushButton > Touch
Implements IDisposable
Inherited Members PushButton.DefaultDebounceDuration PushButton.DefaultGlitchDuration PushButton.DefaultLongPressThreshold PushButton.DebounceDuration PushButton.ButtonPollingInterval PushButton.State PushButton.LongClickedThreshold PushButton.DigitalIn PushButton.PressStarted PushButton.PressEnded PushButton.Clicked PushButton.LongClicked PushButton.IsPolling PushButton.buttonPressStart PushButton.resistorMode PushButton.ctsPolling PushButton.shouldDisposeInput PushButton.CreateInputPort(IPin, ResistorMode) PushButton.RaiseClicked() PushButton.RaisePressStarted() PushButton.RaisePressEnded() PushButton.RaiseLongClicked() PushButton.Dispose() PushButton.Read()
Namespace Meadow.Foundation.Grove.Sensors.Buttons
Assembly Touch.dll

Syntax

public class Touch : PushButton, IDisposable

Constructors

Touch(IPin)

Creates a Touch button driver

Declaration
public Touch(IPin inputPin)

Parameters

Type Name Description
IPin inputPin