Meadow.Foundation.Relays.ElectromagneticRelayModule
| ElectromagneticRelayModule | |
|---|---|
| Status | |
| Source code | GitHub |
| NuGet package |
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
| Type | Name | Description |
|---|---|---|
System.Boolean | pinA0 | State of A0 address pin - true if high |
System.Boolean | pinA1 | State of A1 address pin - true if high |
System.Boolean | pinA2 | State of A2 address pin - true if high |
System.Boolean | isATypeDevice | Is 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
| Type | Name |
|---|---|
System.Boolean | disposing |
Dispose()
Disposes the instances resources
View Source
Declaration
public void Dispose()
Implements
Meadow.Hardware.II2cPeripheralSystem.IDisposable