Remarks

SwitchP
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Grove.Sensors.Switches.SwitchP

Code Example

SwitchP groveSwitch;

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

    groveSwitch = new SwitchP(Device.Pins.D13);

    groveSwitch.Changed += (s, e) =>
    {
        Resolver.Log.Info(groveSwitch.IsOn ? "Switch is High" : "Switch is Low");
    };

    return Task.CompletedTask;
}

Sample project(s) available on GitHub

Wiring Example

SwitchP Meadow Pin
GND GND
VCC 3.3V
RX D01
TX D00
Characteristic Locus
Inheritance object SpdtSwitch > SwitchP
Implements ISwitch ISensor<bool> IDisposable
Inherited Members SpdtSwitch.IsOn SpdtSwitch.DigitalInputPort SpdtSwitch.Changed SpdtSwitch.IsDisposed SpdtSwitch.DigitalInChanged(object, DigitalPortResult) SpdtSwitch.Read() SpdtSwitch.Dispose() SpdtSwitch.Dispose(bool) object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString()
Namespace Meadow.Foundation.Grove.Sensors.Switches
Assembly SwitchP.dll

Syntax

public class SwitchP : SpdtSwitch, ISwitch, ISensor<bool>, IDisposable

Constructors

SwitchP(IPin)

Creates a SwitchP driver

Declaration
public SwitchP(IPin pin)

Parameters

Type Name Description
IPin pin

Remarks

SwitchP
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Grove.Sensors.Switches.SwitchP

Code Example

SwitchP groveSwitch;

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

    groveSwitch = new SwitchP(Device.Pins.D13);

    groveSwitch.Changed += (s, e) =>
    {
        Resolver.Log.Info(groveSwitch.IsOn ? "Switch is High" : "Switch is Low");
    };

    return Task.CompletedTask;
}

Sample project(s) available on GitHub

Wiring Example

SwitchP Meadow Pin
GND GND
VCC 3.3V
RX D01
TX D00