Remarks

FourDigitSevenSegment
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Led.FourDigitSevenSegment

Code Example

FourDigitSevenSegment sevenSegment;

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

    sevenSegment = new FourDigitSevenSegment
    (
        portDigit1: Device.CreateDigitalOutputPort(Device.Pins.D00),
        portDigit2: Device.CreateDigitalOutputPort(Device.Pins.D03),
        portDigit3: Device.CreateDigitalOutputPort(Device.Pins.D04),
        portDigit4: Device.CreateDigitalOutputPort(Device.Pins.D06),
        portA: Device.CreateDigitalOutputPort(Device.Pins.D01),
        portB: Device.CreateDigitalOutputPort(Device.Pins.D05),
        portC: Device.CreateDigitalOutputPort(Device.Pins.D08),
        portD: Device.CreateDigitalOutputPort(Device.Pins.D10),
        portE: Device.CreateDigitalOutputPort(Device.Pins.D11),
        portF: Device.CreateDigitalOutputPort(Device.Pins.D02),
        portG: Device.CreateDigitalOutputPort(Device.Pins.D07),
        portDecimal: Device.CreateDigitalOutputPort(Device.Pins.D09),
        isCommonCathode: true
    );

    return base.Initialize();
}

public override Task Run()
{
    sevenSegment.SetDisplay("1234");

    return base.Run();
}

Sample project(s) available on GitHub

Wiring Example

To wire a Common Cathode Seven Segment Display (like the 5161AS) to your Meadow board, connect the following:

SevenSegment Meadow Pin
portE D11
portD D10
PortDecimal D09
PortC D08
PortG D07
PortD4 D06
PortB D05
PortD3 D04
PortD2 D03
PortF D02
PortA D01
PortD1 D00

It should look like the following diagram:

Wiring Example

Wiring a SevenSegment to a Meadow F7

Characteristic Locus
Inheritance object > FourDigitSevenSegment
Implements IDisposable
Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString()
Namespace Meadow.Foundation.Displays.Led
Assembly FourDigitSevenSegment.dll

Syntax

public class FourDigitSevenSegment : IDisposable

Constructors

FourDigitSevenSegment(IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, bool)

Creates a SevenSegment connected to the specified IDigitalOutputPorts

Declaration
public FourDigitSevenSegment(IDigitalOutputPort portDigit1, IDigitalOutputPort portDigit2, IDigitalOutputPort portDigit3, IDigitalOutputPort portDigit4, IDigitalOutputPort portA, IDigitalOutputPort portB, IDigitalOutputPort portC, IDigitalOutputPort portD, IDigitalOutputPort portE, IDigitalOutputPort portF, IDigitalOutputPort portG, IDigitalOutputPort portDecimal, bool isCommonCathode)

Parameters

Type Name Description
IDigitalOutputPort portDigit1

Port for digit 1

IDigitalOutputPort portDigit2

Port for digit 2

IDigitalOutputPort portDigit3

Port for digit 3

IDigitalOutputPort portDigit4

Port for digit 4

IDigitalOutputPort portA

Port for pin A

IDigitalOutputPort portB

Port for pin B

IDigitalOutputPort portC

Port for pin C

IDigitalOutputPort portD

Port for pin D

IDigitalOutputPort portE

Port for pin E

IDigitalOutputPort portF

Port for pin F

IDigitalOutputPort portG

Port for pin G

IDigitalOutputPort portDecimal

Port for decimal pin

bool isCommonCathode

Is the display common cathode (true)

Remarks

FourDigitSevenSegment
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Led.FourDigitSevenSegment

Code Example

FourDigitSevenSegment sevenSegment;

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

    sevenSegment = new FourDigitSevenSegment
    (
        portDigit1: Device.CreateDigitalOutputPort(Device.Pins.D00),
        portDigit2: Device.CreateDigitalOutputPort(Device.Pins.D03),
        portDigit3: Device.CreateDigitalOutputPort(Device.Pins.D04),
        portDigit4: Device.CreateDigitalOutputPort(Device.Pins.D06),
        portA: Device.CreateDigitalOutputPort(Device.Pins.D01),
        portB: Device.CreateDigitalOutputPort(Device.Pins.D05),
        portC: Device.CreateDigitalOutputPort(Device.Pins.D08),
        portD: Device.CreateDigitalOutputPort(Device.Pins.D10),
        portE: Device.CreateDigitalOutputPort(Device.Pins.D11),
        portF: Device.CreateDigitalOutputPort(Device.Pins.D02),
        portG: Device.CreateDigitalOutputPort(Device.Pins.D07),
        portDecimal: Device.CreateDigitalOutputPort(Device.Pins.D09),
        isCommonCathode: true
    );

    return base.Initialize();
}

public override Task Run()
{
    sevenSegment.SetDisplay("1234");

    return base.Run();
}

Sample project(s) available on GitHub

Wiring Example

To wire a Common Cathode Seven Segment Display (like the 5161AS) to your Meadow board, connect the following:

SevenSegment Meadow Pin
portE D11
portD D10
PortDecimal D09
PortC D08
PortG D07
PortD4 D06
PortB D05
PortD3 D04
PortD2 D03
PortF D02
PortA D01
PortD1 D00

It should look like the following diagram:

Wiring Example

Wiring a SevenSegment to a Meadow F7

FourDigitSevenSegment(IPin, IPin, IPin, IPin, IPin, IPin, IPin, IPin, IPin, IPin, IPin, IPin, bool)

Creates a SevenSegment connected to the specified IPins to a IODevice

Declaration
public FourDigitSevenSegment(IPin pinDigit1, IPin pinDigit2, IPin pinDigit3, IPin pinDigit4, IPin pinA, IPin pinB, IPin pinC, IPin pinD, IPin pinE, IPin pinF, IPin pinG, IPin pinDecimal, bool isCommonCathode)

Parameters

Type Name Description
IPin pinDigit1

Digit 1 pin

IPin pinDigit2

Digit 2 pin

IPin pinDigit3

Digit 3 pin

IPin pinDigit4

Digit 4 pin

IPin pinA

A pin

IPin pinB

B pin

IPin pinC

C pin

IPin pinD

D pin

IPin pinE

E pin

IPin pinF

F pin

IPin pinG

G pin

IPin pinDecimal

Decimal pin

bool isCommonCathode

Is the display common cathode (true)

Remarks

FourDigitSevenSegment
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Led.FourDigitSevenSegment

Code Example

FourDigitSevenSegment sevenSegment;

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

    sevenSegment = new FourDigitSevenSegment
    (
        portDigit1: Device.CreateDigitalOutputPort(Device.Pins.D00),
        portDigit2: Device.CreateDigitalOutputPort(Device.Pins.D03),
        portDigit3: Device.CreateDigitalOutputPort(Device.Pins.D04),
        portDigit4: Device.CreateDigitalOutputPort(Device.Pins.D06),
        portA: Device.CreateDigitalOutputPort(Device.Pins.D01),
        portB: Device.CreateDigitalOutputPort(Device.Pins.D05),
        portC: Device.CreateDigitalOutputPort(Device.Pins.D08),
        portD: Device.CreateDigitalOutputPort(Device.Pins.D10),
        portE: Device.CreateDigitalOutputPort(Device.Pins.D11),
        portF: Device.CreateDigitalOutputPort(Device.Pins.D02),
        portG: Device.CreateDigitalOutputPort(Device.Pins.D07),
        portDecimal: Device.CreateDigitalOutputPort(Device.Pins.D09),
        isCommonCathode: true
    );

    return base.Initialize();
}

public override Task Run()
{
    sevenSegment.SetDisplay("1234");

    return base.Run();
}

Sample project(s) available on GitHub

Wiring Example

To wire a Common Cathode Seven Segment Display (like the 5161AS) to your Meadow board, connect the following:

SevenSegment Meadow Pin
portE D11
portD D10
PortDecimal D09
PortC D08
PortG D07
PortD4 D06
PortB D05
PortD3 D04
PortD2 D03
PortF D02
PortA D01
PortD1 D00

It should look like the following diagram:

Wiring Example

Wiring a SevenSegment to a Meadow F7

Properties

IsDisposed

Is the object disposed

Declaration
public bool IsDisposed { get; }

Property Value

Type Description
bool

Remarks

FourDigitSevenSegment
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Led.FourDigitSevenSegment

Code Example

FourDigitSevenSegment sevenSegment;

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

    sevenSegment = new FourDigitSevenSegment
    (
        portDigit1: Device.CreateDigitalOutputPort(Device.Pins.D00),
        portDigit2: Device.CreateDigitalOutputPort(Device.Pins.D03),
        portDigit3: Device.CreateDigitalOutputPort(Device.Pins.D04),
        portDigit4: Device.CreateDigitalOutputPort(Device.Pins.D06),
        portA: Device.CreateDigitalOutputPort(Device.Pins.D01),
        portB: Device.CreateDigitalOutputPort(Device.Pins.D05),
        portC: Device.CreateDigitalOutputPort(Device.Pins.D08),
        portD: Device.CreateDigitalOutputPort(Device.Pins.D10),
        portE: Device.CreateDigitalOutputPort(Device.Pins.D11),
        portF: Device.CreateDigitalOutputPort(Device.Pins.D02),
        portG: Device.CreateDigitalOutputPort(Device.Pins.D07),
        portDecimal: Device.CreateDigitalOutputPort(Device.Pins.D09),
        isCommonCathode: true
    );

    return base.Initialize();
}

public override Task Run()
{
    sevenSegment.SetDisplay("1234");

    return base.Run();
}

Sample project(s) available on GitHub

Wiring Example

To wire a Common Cathode Seven Segment Display (like the 5161AS) to your Meadow board, connect the following:

SevenSegment Meadow Pin
portE D11
portD D10
PortDecimal D09
PortC D08
PortG D07
PortD4 D06
PortB D05
PortD3 D04
PortD2 D03
PortF D02
PortA D01
PortD1 D00

It should look like the following diagram:

Wiring Example

Wiring a SevenSegment to a Meadow F7

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()

Remarks

FourDigitSevenSegment
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Led.FourDigitSevenSegment

Code Example

FourDigitSevenSegment sevenSegment;

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

    sevenSegment = new FourDigitSevenSegment
    (
        portDigit1: Device.CreateDigitalOutputPort(Device.Pins.D00),
        portDigit2: Device.CreateDigitalOutputPort(Device.Pins.D03),
        portDigit3: Device.CreateDigitalOutputPort(Device.Pins.D04),
        portDigit4: Device.CreateDigitalOutputPort(Device.Pins.D06),
        portA: Device.CreateDigitalOutputPort(Device.Pins.D01),
        portB: Device.CreateDigitalOutputPort(Device.Pins.D05),
        portC: Device.CreateDigitalOutputPort(Device.Pins.D08),
        portD: Device.CreateDigitalOutputPort(Device.Pins.D10),
        portE: Device.CreateDigitalOutputPort(Device.Pins.D11),
        portF: Device.CreateDigitalOutputPort(Device.Pins.D02),
        portG: Device.CreateDigitalOutputPort(Device.Pins.D07),
        portDecimal: Device.CreateDigitalOutputPort(Device.Pins.D09),
        isCommonCathode: true
    );

    return base.Initialize();
}

public override Task Run()
{
    sevenSegment.SetDisplay("1234");

    return base.Run();
}

Sample project(s) available on GitHub

Wiring Example

To wire a Common Cathode Seven Segment Display (like the 5161AS) to your Meadow board, connect the following:

SevenSegment Meadow Pin
portE D11
portD D10
PortDecimal D09
PortC D08
PortG D07
PortD4 D06
PortB D05
PortD3 D04
PortD2 D03
PortF D02
PortA D01
PortD1 D00

It should look like the following diagram:

Wiring Example

Wiring a SevenSegment to a Meadow F7

Dispose(bool)

Dispose of the object

Declaration
protected virtual void Dispose(bool disposing)

Parameters

Type Name Description
bool disposing

Is disposing

Remarks

FourDigitSevenSegment
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Led.FourDigitSevenSegment

Code Example

FourDigitSevenSegment sevenSegment;

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

    sevenSegment = new FourDigitSevenSegment
    (
        portDigit1: Device.CreateDigitalOutputPort(Device.Pins.D00),
        portDigit2: Device.CreateDigitalOutputPort(Device.Pins.D03),
        portDigit3: Device.CreateDigitalOutputPort(Device.Pins.D04),
        portDigit4: Device.CreateDigitalOutputPort(Device.Pins.D06),
        portA: Device.CreateDigitalOutputPort(Device.Pins.D01),
        portB: Device.CreateDigitalOutputPort(Device.Pins.D05),
        portC: Device.CreateDigitalOutputPort(Device.Pins.D08),
        portD: Device.CreateDigitalOutputPort(Device.Pins.D10),
        portE: Device.CreateDigitalOutputPort(Device.Pins.D11),
        portF: Device.CreateDigitalOutputPort(Device.Pins.D02),
        portG: Device.CreateDigitalOutputPort(Device.Pins.D07),
        portDecimal: Device.CreateDigitalOutputPort(Device.Pins.D09),
        isCommonCathode: true
    );

    return base.Initialize();
}

public override Task Run()
{
    sevenSegment.SetDisplay("1234");

    return base.Run();
}

Sample project(s) available on GitHub

Wiring Example

To wire a Common Cathode Seven Segment Display (like the 5161AS) to your Meadow board, connect the following:

SevenSegment Meadow Pin
portE D11
portD D10
PortDecimal D09
PortC D08
PortG D07
PortD4 D06
PortB D05
PortD3 D04
PortD2 D03
PortF D02
PortA D01
PortD1 D00

It should look like the following diagram:

Wiring Example

Wiring a SevenSegment to a Meadow F7

SetDisplay(char[], int)

Displays the specified characters

Declaration
public void SetDisplay(char[] characters, int decimalLocation = -1)

Parameters

Type Name Description
char[] characters

The characters to display

int decimalLocation

The decimal position (0 indexed)

Remarks

FourDigitSevenSegment
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Led.FourDigitSevenSegment

Code Example

FourDigitSevenSegment sevenSegment;

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

    sevenSegment = new FourDigitSevenSegment
    (
        portDigit1: Device.CreateDigitalOutputPort(Device.Pins.D00),
        portDigit2: Device.CreateDigitalOutputPort(Device.Pins.D03),
        portDigit3: Device.CreateDigitalOutputPort(Device.Pins.D04),
        portDigit4: Device.CreateDigitalOutputPort(Device.Pins.D06),
        portA: Device.CreateDigitalOutputPort(Device.Pins.D01),
        portB: Device.CreateDigitalOutputPort(Device.Pins.D05),
        portC: Device.CreateDigitalOutputPort(Device.Pins.D08),
        portD: Device.CreateDigitalOutputPort(Device.Pins.D10),
        portE: Device.CreateDigitalOutputPort(Device.Pins.D11),
        portF: Device.CreateDigitalOutputPort(Device.Pins.D02),
        portG: Device.CreateDigitalOutputPort(Device.Pins.D07),
        portDecimal: Device.CreateDigitalOutputPort(Device.Pins.D09),
        isCommonCathode: true
    );

    return base.Initialize();
}

public override Task Run()
{
    sevenSegment.SetDisplay("1234");

    return base.Run();
}

Sample project(s) available on GitHub

Wiring Example

To wire a Common Cathode Seven Segment Display (like the 5161AS) to your Meadow board, connect the following:

SevenSegment Meadow Pin
portE D11
portD D10
PortDecimal D09
PortC D08
PortG D07
PortD4 D06
PortB D05
PortD3 D04
PortD2 D03
PortF D02
PortA D01
PortD1 D00

It should look like the following diagram:

Wiring Example

Wiring a SevenSegment to a Meadow F7

SetDisplay(string, int)

Displays the specified characters

Declaration
public void SetDisplay(string characters, int decimalLocation = -1)

Parameters

Type Name Description
string characters

The characters to display

int decimalLocation

The decimal position (0 indexed)

Remarks

FourDigitSevenSegment
Status Status badge: working
Source code GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Led.FourDigitSevenSegment

Code Example

FourDigitSevenSegment sevenSegment;

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

    sevenSegment = new FourDigitSevenSegment
    (
        portDigit1: Device.CreateDigitalOutputPort(Device.Pins.D00),
        portDigit2: Device.CreateDigitalOutputPort(Device.Pins.D03),
        portDigit3: Device.CreateDigitalOutputPort(Device.Pins.D04),
        portDigit4: Device.CreateDigitalOutputPort(Device.Pins.D06),
        portA: Device.CreateDigitalOutputPort(Device.Pins.D01),
        portB: Device.CreateDigitalOutputPort(Device.Pins.D05),
        portC: Device.CreateDigitalOutputPort(Device.Pins.D08),
        portD: Device.CreateDigitalOutputPort(Device.Pins.D10),
        portE: Device.CreateDigitalOutputPort(Device.Pins.D11),
        portF: Device.CreateDigitalOutputPort(Device.Pins.D02),
        portG: Device.CreateDigitalOutputPort(Device.Pins.D07),
        portDecimal: Device.CreateDigitalOutputPort(Device.Pins.D09),
        isCommonCathode: true
    );

    return base.Initialize();
}

public override Task Run()
{
    sevenSegment.SetDisplay("1234");

    return base.Run();
}

Sample project(s) available on GitHub

Wiring Example

To wire a Common Cathode Seven Segment Display (like the 5161AS) to your Meadow board, connect the following:

SevenSegment Meadow Pin
portE D11
portD D10
PortDecimal D09
PortC D08
PortG D07
PortD4 D06
PortB D05
PortD3 D04
PortD2 D03
PortF D02
PortA D01
PortD1 D00

It should look like the following diagram:

Wiring Example

Wiring a SevenSegment to a Meadow F7