Meadow.Foundation.ICs.IOExpanders.Ht16k33
Ht16k33 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | 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
Ht16k33 ht16k33;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
ht16k33 = new Ht16k33(Device.CreateI2cBus());
return base.Initialize();
}
public override async Task Run()
{
int index = 0;
bool on = true;
while (true)
{
ht16k33.SetLed((byte)index, on);
ht16k33.UpdateDisplay();
index++;
if (index >= 128)
{
index = 0;
on = !on;
}
await Task.Delay(100);
}
}
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) |