Skip to main content

Meadow.Foundation.Displays.Led.FourDigitSevenSegment

FourDigitSevenSegment
StatusStatus badge: working
Source codeGitHub
NuGet packageNuGet 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:

SevenSegmentMeadow Pin
portED11
portDD10
PortDecimalD09
PortCD08
PortGD07
PortD4D06
PortBD05
PortD3D04
PortD2D03
PortFD02
PortAD01
PortD1D00

It should look like the following diagram:

Wiring Example

Wiring a SevenSegment to a Meadow F7