Meadow.Foundation.Displays.Tm1637
Tm1637 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | 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
Tm1637 display;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
display = new Tm1637(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) |
Class Tm1637
Represents Tm1637 segment display
Assembly: Tm1637.dll
View Source
public class Tm1637 : IDisposable
Implements:
System.IDisposable
Properties
MAX_SEGMENTS
Max segments for a TM1637 controller
View Source
public byte MAX_SEGMENTS { get; }
SegmentOrder
Order of segments
View Source
public byte[] SegmentOrder { get; set; }
ScreenOn
Set the screen on or off
View Source
public bool ScreenOn { get; set; }
Brightness
Adjust the screen brightness from 0 to 7
View Source
public byte Brightness { get; set; }
IsDisposed
Is the object disposed
View Source
public bool IsDisposed { get; }
Methods
Show(ReadOnlySpan<Character>)
Displays a series of prebuilt characters including the dot or not You can build your own characters with the primitives like Bottom, Top, Dot
View Source
public void Show(ReadOnlySpan<Character> data)
Parameters
Type | Name | Description |
---|---|---|
System.ReadOnlySpan<Meadow.Foundation.Displays.Character> | data | The Character to display |
Show(byte, Character)
Displays a raw data at a specific segment position from 0 to 5
View Source
public void Show(byte index, Character character)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | index | The segment position from 0 to 5 |
Meadow.Foundation.Displays.Character | character | The segment characters to display |
Clear()
Clear the display
View Source
public void Clear()
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
View Source
public void Dispose()
Dispose(bool)
Dispose of the object
View Source
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Is disposing |
Implements
System.IDisposable