Meadow.Foundation.Grove.Sensors.Switches.SwitchP
SwitchP | |
---|---|
Status | |
Source code | GitHub |
NuGet package |
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 |
Class SwitchP
Represents a SwitchP
Assembly: SwitchP.dll
View Source
Declaration
public class SwitchP : SpdtSwitch, ISwitch, ISensor<bool>, ISensor, IDisposable
Inheritance: System.Object
-> Meadow.Foundation.Sensors.Switches.SpdtSwitch
Implements:
Meadow.Peripherals.Switches.ISwitch
, Meadow.Peripherals.Sensors.ISensor<System.Boolean>
, Meadow.Peripherals.Sensors.ISensor
, System.IDisposable
Implements
Meadow.Peripherals.Switches.ISwitch
Meadow.Peripherals.Sensors.ISensor<System.Boolean>
Meadow.Peripherals.Sensors.ISensor
System.IDisposable