Skip to main content

Meadow.Foundation.Grove.Sensors.Switches.MagneticSwitch

MagneticSwitch
StatusStatus badge: working
Source codeGitHub
NuGet packageNuGet Gallery for Meadow.Foundation.Grove.Sensors.Switches.MagneticSwitch

Code Example

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

var magneticSwitch = new MagneticSwitch(Device.Pins.D13);

magneticSwitch.Changed += (s, e) =>
{
Resolver.Log.Info($"Switched - open {magneticSwitch.IsOn}");
};

return Task.CompletedTask;
}

Sample project(s) available on GitHub

Wiring Example

MagneticSwitchMeadow Pin
GNDGND
VCC3.3V
RXD01
TXD00