Skip to main content

Meadow.Foundation.Relays.ElectromagneticRelayModule

ElectromagneticRelayModule
StatusStatus badge: working
Source codeGitHub
NuGet packageNuGet Gallery for Meadow.Foundation.Relays.ElectromagneticRelayModule

API Reference​

Class ElectromagneticRelayModule

Represents a 4 Channel I2C Electromagnetic Relay Module powered by a PCF8574 IO expander

Assembly: ElectromagneticRelayModule.dll​
View Source​
Declaration
public class ElectromagneticRelayModule : II2cPeripheral, IDisposable

Implements:
Meadow.Hardware.II2cPeripheral, System.IDisposable

Properties​

DefaultI2cAddress​

The default I2C address for the peripheral

View Source​
Declaration
public byte DefaultI2cAddress { get; }

Fields​

Relays​

The relays

View Source​
Declaration
public readonly Relay[] Relays

ioExpander​

PCF8574 object

View Source​
Declaration
protected readonly Pcf8574 ioExpander

ports​

The digital output ports for the relays

View Source​
Declaration
protected readonly IDigitalOutputPort[] ports

Methods​

GetAddressFromPins(bool, bool, bool, bool)​

Helper method to get address from address pin configuation

View Source​
Declaration
public static byte GetAddressFromPins(bool pinA0, bool pinA1, bool pinA2, bool isATypeDevice = false)
Returns​

System.Byte: The device address

Parameters​
TypeNameDescription
System.BooleanpinA0State of A0 address pin - true if high
System.BooleanpinA1State of A1 address pin - true if high
System.BooleanpinA2State of A2 address pin - true if high
System.BooleanisATypeDeviceIs an A hardware variant, this shifts the address returned by 24

SetAllOn()​

Set all relays on

View Source​
Declaration
public void SetAllOn()

SetAllOff()​

Set all relays off

View Source​
Declaration
public void SetAllOff()

Dispose(bool)​

Disposes the instances resources

View Source​
Declaration
protected virtual void Dispose(bool disposing)
Parameters​
TypeName
System.Booleandisposing

Dispose()​

Disposes the instances resources

View Source​
Declaration
public void Dispose()

Implements​

  • Meadow.Hardware.II2cPeripheral
  • System.IDisposable