Remarks
Touch | |
---|---|
Status | |
Source code | GitHub |
NuGet package |
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 |
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 | |
Source code | GitHub |
NuGet package |
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 |