Remarks

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

The TM1637 is a led driver and keyboard scan interface. However, this chip is almost exclusively found pre-assembled with with 4 7-segment displays.

Purchasing

Code Example

Tm1637 display;

public override Task Initialize()
{
    Console.WriteLine("Initialize...");

    display = new Tm1637(Device, Device.Pins.D02, Device.Pins.D01);

    display.Brightness = 7;
    display.ScreenOn = true;

    return Task.CompletedTask;
}

public override Task Run()
{
    display.Clear();

    var chars = new Character[] { Character.A, Character.B, Character.C, Character.D };

    display.Show(chars);

    return Task.CompletedTask;
}

Sample project(s) available on GitHub

Wiring Example

To wire a TM1637 to your Meadow board, connect the following:

TM1637 Meadow Pin
GND GND
VCC 3V3
SCL D08 (SCL Pin)
SDA D07 (SDA Pin)

Characteristic Locus
Inheritance System.Object > Tm1637
Namespace Meadow.Foundation.Displays
Assembly Tm1637.dll

Syntax

public class Tm1637 : object

Constructors

Tm1637(IMeadowDevice, IPin, IPin)

Initialize a TM1637

Declaration
public Tm1637(IMeadowDevice device, IPin pinClock, IPin pinData)

Parameters

Type Name Description
IMeadowDevice device
IPin pinClock

The clock pin

IPin pinData

The data pin

Properties

Brightness

Adjust the screen brightness from 0 to 7

Declaration
public byte Brightness { get; set; }

Property Value

Type Description
System.Byte

MAX_SEGMENTS

Max segments for a TM1637 controller

Declaration
public byte MAX_SEGMENTS { get; }

Property Value

Type Description
System.Byte

ScreenOn

Set the screen on or off

Declaration
public bool ScreenOn { get; set; }

Property Value

Type Description
System.Boolean

SegmentOrder

Order of segments

Declaration
public byte[] SegmentOrder { get; set; }

Property Value

Type Description
System.Byte[]

Methods

Clear()

Clear the display

Declaration
public void Clear()

Show(ReadOnlySpan<Character>)

Displays a series of prebuild characters including the dot or not You can build yourwwon characters with the primitives like Bottom, Top, Dot

Declaration
public void Show(ReadOnlySpan<Character> data)

Parameters

Type Name Description
ReadOnlySpan<Character> data

The Character to display

Show(Byte, Character)

Displays a raw data at a specific segment position from 0 to 5

Declaration
public void Show(byte index, Character character)

Parameters

Type Name Description
System.Byte index

The segment position from 0 to 5

Character character

The segemnet characters to display