Remarks

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

Code Example

Tilt tiltSwitch;

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

    tiltSwitch = new Tilt(Device.Pins.D13);

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

    return Task.CompletedTask;
}

Sample project(s) available on GitHub

Wiring Example

Tilt Meadow Pin
GND GND
VCC 3.3V
RX D01
TX D00
Characteristic Locus
Inheritance object SpdtSwitch > Tilt
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 Tilt.dll

Syntax

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

Constructors

Tilt(IPin)

Creates a Tilt driver

Declaration
public Tilt(IPin pin)

Parameters

Type Name Description
IPin pin

Remarks

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

Code Example

Tilt tiltSwitch;

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

    tiltSwitch = new Tilt(Device.Pins.D13);

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

    return Task.CompletedTask;
}

Sample project(s) available on GitHub

Wiring Example

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