Remarks

SevenSegment
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Led.SevenSegment

A seven-segment display is a form of electronic display device used to show decimal numbers. These displays are widely used in digital clocks, electronic meters, basic calculators, and other electronic devices that display numerical information.

The SevenSegment driver is used to represent a 7-segment display controlled via GPIO.

The displays are simply a collection of single color leds in a pre-configured solutions. The segments are commonly referred to using letters, the top segment is A, and increase alphabetically as you move clockwise around the display. The center segment is G and the decimal or period is dp.

The pinouts vary from device to device, check the documentation to map the pinouts to a specific segment. The come in a wide selection of colors and may be common anode or common cathode.

SevenSegment displays

Code Example

SevenSegment sevenSegment;

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

    sevenSegment = new SevenSegment
    (
        portA: Device.CreateDigitalOutputPort(Device.Pins.D14),
        portB: Device.CreateDigitalOutputPort(Device.Pins.D15),
        portC: Device.CreateDigitalOutputPort(Device.Pins.D06),
        portD: Device.CreateDigitalOutputPort(Device.Pins.D07),
        portE: Device.CreateDigitalOutputPort(Device.Pins.D08),
        portF: Device.CreateDigitalOutputPort(Device.Pins.D13),
        portG: Device.CreateDigitalOutputPort(Device.Pins.D12),
        portDecimal: Device.CreateDigitalOutputPort(Device.Pins.D05),
        isCommonCathode: false
    );

    return base.Initialize();
}

public override Task Run()
{
    sevenSegment.SetDisplay(character: '1', showDecimal: true);

    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
portA D14
portB D15
PortC D06
PortD D07
PortE D08
PortF D13
PortG D12
portDecimal D05
Common Cathode GND

It should look like the following diagram:

Wiring a SevenSegment to a Meadow F7

Characteristic Locus
Inheritance object > SevenSegment
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 SevenSegment.dll

Syntax

public class SevenSegment : IDisposable

Constructors

SevenSegment(IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, bool)

Creates a SevenSegment connected to the specified IDigitalOutputPorts

Declaration
public SevenSegment(IDigitalOutputPort portA, IDigitalOutputPort portB, IDigitalOutputPort portC, IDigitalOutputPort portD, IDigitalOutputPort portE, IDigitalOutputPort portF, IDigitalOutputPort portG, IDigitalOutputPort portDecimal, bool isCommonCathode)

Parameters

Type Name Description
IDigitalOutputPort portA

Digital input port for pin A

IDigitalOutputPort portB

Digital input port for pin B

IDigitalOutputPort portC

Digital input port for pin C

IDigitalOutputPort portD

Digital input port for pin D

IDigitalOutputPort portE

Digital input port for pin E

IDigitalOutputPort portF

Digital input port for pin F

IDigitalOutputPort portG

Digital input port for pin G

IDigitalOutputPort portDecimal

Digital input port for decimal pin

bool isCommonCathode

Is the display using common cathode (true) or common anode (false)

Remarks

SevenSegment
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Led.SevenSegment

A seven-segment display is a form of electronic display device used to show decimal numbers. These displays are widely used in digital clocks, electronic meters, basic calculators, and other electronic devices that display numerical information.

The SevenSegment driver is used to represent a 7-segment display controlled via GPIO.

The displays are simply a collection of single color leds in a pre-configured solutions. The segments are commonly referred to using letters, the top segment is A, and increase alphabetically as you move clockwise around the display. The center segment is G and the decimal or period is dp.

The pinouts vary from device to device, check the documentation to map the pinouts to a specific segment. The come in a wide selection of colors and may be common anode or common cathode.

SevenSegment displays

Code Example

SevenSegment sevenSegment;

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

    sevenSegment = new SevenSegment
    (
        portA: Device.CreateDigitalOutputPort(Device.Pins.D14),
        portB: Device.CreateDigitalOutputPort(Device.Pins.D15),
        portC: Device.CreateDigitalOutputPort(Device.Pins.D06),
        portD: Device.CreateDigitalOutputPort(Device.Pins.D07),
        portE: Device.CreateDigitalOutputPort(Device.Pins.D08),
        portF: Device.CreateDigitalOutputPort(Device.Pins.D13),
        portG: Device.CreateDigitalOutputPort(Device.Pins.D12),
        portDecimal: Device.CreateDigitalOutputPort(Device.Pins.D05),
        isCommonCathode: false
    );

    return base.Initialize();
}

public override Task Run()
{
    sevenSegment.SetDisplay(character: '1', showDecimal: true);

    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
portA D14
portB D15
PortC D06
PortD D07
PortE D08
PortF D13
PortG D12
portDecimal D05
Common Cathode GND

It should look like the following diagram:

Wiring a SevenSegment to a Meadow F7

SevenSegment(IPin, IPin, IPin, IPin, IPin, IPin, IPin, IPin, bool)

Creates a SevenSegment connected to the specified IPins to a IODevice

Declaration
public SevenSegment(IPin pinA, IPin pinB, IPin pinC, IPin pinD, IPin pinE, IPin pinF, IPin pinG, IPin pinDecimal, bool isCommonCathode)

Parameters

Type Name Description
IPin pinA

Pin A

IPin pinB

Pin B

IPin pinC

Pin C

IPin pinD

Pin D

IPin pinE

Pin E

IPin pinF

Pin F

IPin pinG

Pin G

IPin pinDecimal

Pin decimal

bool isCommonCathode

Is the display using common cathode (true) or common anode (false)

Remarks

SevenSegment
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Led.SevenSegment

A seven-segment display is a form of electronic display device used to show decimal numbers. These displays are widely used in digital clocks, electronic meters, basic calculators, and other electronic devices that display numerical information.

The SevenSegment driver is used to represent a 7-segment display controlled via GPIO.

The displays are simply a collection of single color leds in a pre-configured solutions. The segments are commonly referred to using letters, the top segment is A, and increase alphabetically as you move clockwise around the display. The center segment is G and the decimal or period is dp.

The pinouts vary from device to device, check the documentation to map the pinouts to a specific segment. The come in a wide selection of colors and may be common anode or common cathode.

SevenSegment displays

Code Example

SevenSegment sevenSegment;

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

    sevenSegment = new SevenSegment
    (
        portA: Device.CreateDigitalOutputPort(Device.Pins.D14),
        portB: Device.CreateDigitalOutputPort(Device.Pins.D15),
        portC: Device.CreateDigitalOutputPort(Device.Pins.D06),
        portD: Device.CreateDigitalOutputPort(Device.Pins.D07),
        portE: Device.CreateDigitalOutputPort(Device.Pins.D08),
        portF: Device.CreateDigitalOutputPort(Device.Pins.D13),
        portG: Device.CreateDigitalOutputPort(Device.Pins.D12),
        portDecimal: Device.CreateDigitalOutputPort(Device.Pins.D05),
        isCommonCathode: false
    );

    return base.Initialize();
}

public override Task Run()
{
    sevenSegment.SetDisplay(character: '1', showDecimal: true);

    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
portA D14
portB D15
PortC D06
PortD D07
PortE D08
PortF D13
PortG D12
portDecimal D05
Common Cathode GND

It should look like the following diagram:

Wiring a SevenSegment to a Meadow F7

Properties

IsDisposed

Is the object disposed

Declaration
public bool IsDisposed { get; }

Property Value

Type Description
bool

Remarks

SevenSegment
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Led.SevenSegment

A seven-segment display is a form of electronic display device used to show decimal numbers. These displays are widely used in digital clocks, electronic meters, basic calculators, and other electronic devices that display numerical information.

The SevenSegment driver is used to represent a 7-segment display controlled via GPIO.

The displays are simply a collection of single color leds in a pre-configured solutions. The segments are commonly referred to using letters, the top segment is A, and increase alphabetically as you move clockwise around the display. The center segment is G and the decimal or period is dp.

The pinouts vary from device to device, check the documentation to map the pinouts to a specific segment. The come in a wide selection of colors and may be common anode or common cathode.

SevenSegment displays

Code Example

SevenSegment sevenSegment;

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

    sevenSegment = new SevenSegment
    (
        portA: Device.CreateDigitalOutputPort(Device.Pins.D14),
        portB: Device.CreateDigitalOutputPort(Device.Pins.D15),
        portC: Device.CreateDigitalOutputPort(Device.Pins.D06),
        portD: Device.CreateDigitalOutputPort(Device.Pins.D07),
        portE: Device.CreateDigitalOutputPort(Device.Pins.D08),
        portF: Device.CreateDigitalOutputPort(Device.Pins.D13),
        portG: Device.CreateDigitalOutputPort(Device.Pins.D12),
        portDecimal: Device.CreateDigitalOutputPort(Device.Pins.D05),
        isCommonCathode: false
    );

    return base.Initialize();
}

public override Task Run()
{
    sevenSegment.SetDisplay(character: '1', showDecimal: true);

    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
portA D14
portB D15
PortC D06
PortD D07
PortE D08
PortF D13
PortG D12
portDecimal D05
Common Cathode GND

It should look like the following diagram:

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

SevenSegment
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Led.SevenSegment

A seven-segment display is a form of electronic display device used to show decimal numbers. These displays are widely used in digital clocks, electronic meters, basic calculators, and other electronic devices that display numerical information.

The SevenSegment driver is used to represent a 7-segment display controlled via GPIO.

The displays are simply a collection of single color leds in a pre-configured solutions. The segments are commonly referred to using letters, the top segment is A, and increase alphabetically as you move clockwise around the display. The center segment is G and the decimal or period is dp.

The pinouts vary from device to device, check the documentation to map the pinouts to a specific segment. The come in a wide selection of colors and may be common anode or common cathode.

SevenSegment displays

Code Example

SevenSegment sevenSegment;

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

    sevenSegment = new SevenSegment
    (
        portA: Device.CreateDigitalOutputPort(Device.Pins.D14),
        portB: Device.CreateDigitalOutputPort(Device.Pins.D15),
        portC: Device.CreateDigitalOutputPort(Device.Pins.D06),
        portD: Device.CreateDigitalOutputPort(Device.Pins.D07),
        portE: Device.CreateDigitalOutputPort(Device.Pins.D08),
        portF: Device.CreateDigitalOutputPort(Device.Pins.D13),
        portG: Device.CreateDigitalOutputPort(Device.Pins.D12),
        portDecimal: Device.CreateDigitalOutputPort(Device.Pins.D05),
        isCommonCathode: false
    );

    return base.Initialize();
}

public override Task Run()
{
    sevenSegment.SetDisplay(character: '1', showDecimal: true);

    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
portA D14
portB D15
PortC D06
PortD D07
PortE D08
PortF D13
PortG D12
portDecimal D05
Common Cathode GND

It should look like the following diagram:

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

SevenSegment
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Led.SevenSegment

A seven-segment display is a form of electronic display device used to show decimal numbers. These displays are widely used in digital clocks, electronic meters, basic calculators, and other electronic devices that display numerical information.

The SevenSegment driver is used to represent a 7-segment display controlled via GPIO.

The displays are simply a collection of single color leds in a pre-configured solutions. The segments are commonly referred to using letters, the top segment is A, and increase alphabetically as you move clockwise around the display. The center segment is G and the decimal or period is dp.

The pinouts vary from device to device, check the documentation to map the pinouts to a specific segment. The come in a wide selection of colors and may be common anode or common cathode.

SevenSegment displays

Code Example

SevenSegment sevenSegment;

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

    sevenSegment = new SevenSegment
    (
        portA: Device.CreateDigitalOutputPort(Device.Pins.D14),
        portB: Device.CreateDigitalOutputPort(Device.Pins.D15),
        portC: Device.CreateDigitalOutputPort(Device.Pins.D06),
        portD: Device.CreateDigitalOutputPort(Device.Pins.D07),
        portE: Device.CreateDigitalOutputPort(Device.Pins.D08),
        portF: Device.CreateDigitalOutputPort(Device.Pins.D13),
        portG: Device.CreateDigitalOutputPort(Device.Pins.D12),
        portDecimal: Device.CreateDigitalOutputPort(Device.Pins.D05),
        isCommonCathode: false
    );

    return base.Initialize();
}

public override Task Run()
{
    sevenSegment.SetDisplay(character: '1', showDecimal: true);

    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
portA D14
portB D15
PortC D06
PortD D07
PortE D08
PortF D13
PortG D12
portDecimal D05
Common Cathode GND

It should look like the following diagram:

Wiring a SevenSegment to a Meadow F7

SetDisplay(CharacterType, bool)

Displays the specified character

Declaration
public void SetDisplay(SevenSegment.CharacterType character, bool showDecimal = false)

Parameters

Type Name Description
SevenSegment.CharacterType character
bool showDecimal

Remarks

SevenSegment
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Led.SevenSegment

A seven-segment display is a form of electronic display device used to show decimal numbers. These displays are widely used in digital clocks, electronic meters, basic calculators, and other electronic devices that display numerical information.

The SevenSegment driver is used to represent a 7-segment display controlled via GPIO.

The displays are simply a collection of single color leds in a pre-configured solutions. The segments are commonly referred to using letters, the top segment is A, and increase alphabetically as you move clockwise around the display. The center segment is G and the decimal or period is dp.

The pinouts vary from device to device, check the documentation to map the pinouts to a specific segment. The come in a wide selection of colors and may be common anode or common cathode.

SevenSegment displays

Code Example

SevenSegment sevenSegment;

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

    sevenSegment = new SevenSegment
    (
        portA: Device.CreateDigitalOutputPort(Device.Pins.D14),
        portB: Device.CreateDigitalOutputPort(Device.Pins.D15),
        portC: Device.CreateDigitalOutputPort(Device.Pins.D06),
        portD: Device.CreateDigitalOutputPort(Device.Pins.D07),
        portE: Device.CreateDigitalOutputPort(Device.Pins.D08),
        portF: Device.CreateDigitalOutputPort(Device.Pins.D13),
        portG: Device.CreateDigitalOutputPort(Device.Pins.D12),
        portDecimal: Device.CreateDigitalOutputPort(Device.Pins.D05),
        isCommonCathode: false
    );

    return base.Initialize();
}

public override Task Run()
{
    sevenSegment.SetDisplay(character: '1', showDecimal: true);

    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
portA D14
portB D15
PortC D06
PortD D07
PortE D08
PortF D13
PortG D12
portDecimal D05
Common Cathode GND

It should look like the following diagram:

Wiring a SevenSegment to a Meadow F7

SetDisplay(char, bool)

Displays the specified valid character

Declaration
public void SetDisplay(char character, bool showDecimal = false)

Parameters

Type Name Description
char character
bool showDecimal

Remarks

SevenSegment
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Led.SevenSegment

A seven-segment display is a form of electronic display device used to show decimal numbers. These displays are widely used in digital clocks, electronic meters, basic calculators, and other electronic devices that display numerical information.

The SevenSegment driver is used to represent a 7-segment display controlled via GPIO.

The displays are simply a collection of single color leds in a pre-configured solutions. The segments are commonly referred to using letters, the top segment is A, and increase alphabetically as you move clockwise around the display. The center segment is G and the decimal or period is dp.

The pinouts vary from device to device, check the documentation to map the pinouts to a specific segment. The come in a wide selection of colors and may be common anode or common cathode.

SevenSegment displays

Code Example

SevenSegment sevenSegment;

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

    sevenSegment = new SevenSegment
    (
        portA: Device.CreateDigitalOutputPort(Device.Pins.D14),
        portB: Device.CreateDigitalOutputPort(Device.Pins.D15),
        portC: Device.CreateDigitalOutputPort(Device.Pins.D06),
        portD: Device.CreateDigitalOutputPort(Device.Pins.D07),
        portE: Device.CreateDigitalOutputPort(Device.Pins.D08),
        portF: Device.CreateDigitalOutputPort(Device.Pins.D13),
        portG: Device.CreateDigitalOutputPort(Device.Pins.D12),
        portDecimal: Device.CreateDigitalOutputPort(Device.Pins.D05),
        isCommonCathode: false
    );

    return base.Initialize();
}

public override Task Run()
{
    sevenSegment.SetDisplay(character: '1', showDecimal: true);

    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
portA D14
portB D15
PortC D06
PortD D07
PortE D08
PortF D13
PortG D12
portDecimal D05
Common Cathode GND

It should look like the following diagram:

Wiring a SevenSegment to a Meadow F7