Skip to main content

Meadow.Foundation.Grove.Sensors.Buttons.LEDButton

LEDButton
StatusStatus badge: working
Source codeGitHub
NuGet packageNuGet Gallery for Meadow.Foundation.Grove.Sensors.Buttons.LEDButton

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

LEDButtonMeadow Pin
GNDGND
VCC3.3V
RXD01
TXD00