Meadow.Foundation.Grove.Sensors.Switches.MagneticSwitch
MagneticSwitch | |
---|---|
Status | |
Source code | GitHub |
NuGet package |
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
MagneticSwitch | Meadow Pin |
---|---|
GND | GND |
VCC | 3.3V |
RX | D01 |
TX | D00 |