Meadow.Foundation.Grove.Sensors.Buttons.LEDButton
LEDButton | |
---|---|
Status | |
Source code | GitHub |
NuGet package |
Code Example
LEDButton ledButton;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
ledButton = new LEDButton(buttonPin: Device.Pins.D12, ledPin: Device.Pins.D13);
ledButton.LongClickedThreshold = TimeSpan.FromMilliseconds(1500);
ledButton.Clicked += (s, e) =>
{
Resolver.Log.Info("Grove Button clicked");
ledButton.IsLedOn = !ledButton.IsLedOn;
};
ledButton.LongClicked += (s, e) =>
{
Resolver.Log.Info("Grove Button long clicked");
};
return Task.CompletedTask;
}
Sample project(s) available on GitHub
Wiring Example
LEDButton | Meadow Pin |
---|---|
GND | GND |
VCC | 3.3V |
RX | D01 |
TX | D00 |