Class MagneticSwitch
Represents a Magnetic Switch
Assembly: MagneticSwitch.dll
View Source
Declaration
public class MagneticSwitch : ISwitch, ISensor<bool>, ISensor
Implements:
Meadow.Peripherals.Switches.ISwitch
, Meadow.Peripherals.Sensors.ISensor<System.Boolean>
, Meadow.Peripherals.Sensors.ISensor
Properties
IsOn
Returns the state of the switch
View Source
Declaration
public bool IsOn { get; }
Methods
Read()
Returns the state of the switch
View Source
Declaration
public Task<bool> Read()
Returns
System.Threading.Tasks.Task<System.Boolean>
Events
Changed
Event triggered when status has changed
View Source
Declaration
public event EventHandler Changed
Event Type
System.EventHandler
Implements
Meadow.Peripherals.Switches.ISwitch
Meadow.Peripherals.Sensors.ISensor<System.Boolean>
Meadow.Peripherals.Sensors.ISensor