Remarks

HT16K33
Status
Source code GitHub
NuGet package

The HT16K33 is an LED driver and key scanner. It can be used to drive up to 128 leds and is often found pre-assembled with 14-segment led displays. The HT16K33 is controlled via I2C.

Code Example

public class MeadowApp : App<F7Micro, MeadowApp>
{
    HT16K33 ht16k33;

    public MeadowApp()
    {
        ht16k33 = new HT16K33(Device.CreateI2cBus());

        TestHT16K33();
    }

    void TestHT16K33() 
    {
        int index = 0;
        bool on = true;

        while (true)
        {
            ht16k33.ToggleLed((byte)index, on);
            ht16k33.UpdateDisplay();
            index++;

            if (index >= 128)
            {
                index = 0;
                on = !on;
            }

            Thread.Sleep(100);
        }
    }
}

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 > Ht16K33
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.ICs.IOExpanders
Assembly Ht16K33.dll

Syntax

public class Ht16K33

Constructors

View Source

Ht16K33(II2cBus, Byte)

Create a new HT16K33 object using the default parameters

Declaration
public Ht16K33(II2cBus i2cBus, byte address = 112)

Parameters

Type Name Description
II2cBus i2cBus

I2C bus instance

System.Byte address

Address of the bus on the I2C display.

Methods

View Source

ClearDisplay()

Declaration
public void ClearDisplay()
View Source

IsLedOn(Int32)

Declaration
public bool IsLedOn(int ledIndex)

Parameters

Type Name Description
System.Int32 ledIndex

Returns

Type Description
System.Boolean
View Source

SetBlinkRate(Ht16K33.BlinkRate)

Declaration
public void SetBlinkRate(Ht16K33.BlinkRate blinkRate)

Parameters

Type Name Description
Ht16K33.BlinkRate blinkRate
View Source

SetBrightness(Ht16K33.Brightness)

Declaration
public void SetBrightness(Ht16K33.Brightness brightness)

Parameters

Type Name Description
Ht16K33.Brightness brightness
View Source

ToggleLed(Byte, Boolean)

Declaration
public void ToggleLed(byte ledIndex, bool ledOn)

Parameters

Type Name Description
System.Byte ledIndex
System.Boolean ledOn
View Source

UpdateDisplay()

Declaration
public void UpdateDisplay()