Remarks

Relay
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Grove.Relays.Relay

Code Example

Relay relay;

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

    relay = new Relay(Device.Pins.D13);

    return Task.CompletedTask;
}

public override async Task Run()
{
    var state = false;

    while (true)
    {
        state = !state;

        Resolver.Log.Info($"- State: {state}");
        relay.IsOn = state;

        await Task.Delay(500);
    }
}

Sample project(s) available on GitHub

Wiring Example

Relay Meadow Pin
GND GND
VCC 3.3V
RX D01
TX D00
Characteristic Locus
Inheritance object Relay > Relay
Implements IRelay
Inherited Members Relay.OnRelayChanged Relay.DigitalOut Relay.Type Relay.IsOn Relay.Toggle() object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString()
Namespace Meadow.Foundation.Grove.Relays
Assembly Relay.dll

Syntax

public class Relay : Relay, IRelay

Constructors

Relay(IDigitalOutputPort)

Creates a new Relay driver

Declaration
public Relay(IDigitalOutputPort port)

Parameters

Type Name Description
IDigitalOutputPort port

Remarks

Relay
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Grove.Relays.Relay

Code Example

Relay relay;

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

    relay = new Relay(Device.Pins.D13);

    return Task.CompletedTask;
}

public override async Task Run()
{
    var state = false;

    while (true)
    {
        state = !state;

        Resolver.Log.Info($"- State: {state}");
        relay.IsOn = state;

        await Task.Delay(500);
    }
}

Sample project(s) available on GitHub

Wiring Example

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

Relay(IPin)

Creates a new Relay driver

Declaration
public Relay(IPin pin)

Parameters

Type Name Description
IPin pin

Remarks

Relay
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Grove.Relays.Relay

Code Example

Relay relay;

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

    relay = new Relay(Device.Pins.D13);

    return Task.CompletedTask;
}

public override async Task Run()
{
    var state = false;

    while (true)
    {
        state = !state;

        Resolver.Log.Info($"- State: {state}");
        relay.IsOn = state;

        await Task.Delay(500);
    }
}

Sample project(s) available on GitHub

Wiring Example

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