Remarks

TM1637
Status
Source code GitHub
NuGet package

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

The following example shows how to initialize a TEA5767 and display an array of characters:

public class MeadowApp : App<F7Micro, MeadowApp>
{
    Tm1637 display;

    public MeadowApp()
    {
        display = new Tm1637(Device, Device.Pins.D02, Device.Pins.D01);
        display.Brightness = 7;
        display.ScreenOn = true;
        display.Clear();

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

        display.Show(chars);
    }
}

Sample projects 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
Inherited Members System.Object.ToString() System.Object.Equals(System.Object) System.Object.Equals(System.Object, System.Object) System.Object.ReferenceEquals(System.Object, System.Object) System.Object.GetHashCode() System.Object.GetType() System.Object.MemberwiseClone()
Namespace Meadow.Foundation.Displays
Assembly Tm1637.dll

Syntax

public sealed class Tm1637

Constructors

Tm1637(IIODevice, IPin, IPin)

Initialize a TM1637

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

Parameters

Type Name Description
IIODevice 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