nanoFramework.Iot.Device.Tm1637
1.2.772
Prefix Reserved
dotnet add package nanoFramework.Iot.Device.Tm1637 --version 1.2.772
NuGet\Install-Package nanoFramework.Iot.Device.Tm1637 -Version 1.2.772
<PackageReference Include="nanoFramework.Iot.Device.Tm1637" Version="1.2.772" />
paket add nanoFramework.Iot.Device.Tm1637 --version 1.2.772
#r "nuget: nanoFramework.Iot.Device.Tm1637, 1.2.772"
// Install nanoFramework.Iot.Device.Tm1637 as a Cake Addin #addin nuget:?package=nanoFramework.Iot.Device.Tm1637&version=1.2.772 // Install nanoFramework.Iot.Device.Tm1637 as a Cake Tool #tool nuget:?package=nanoFramework.Iot.Device.Tm1637&version=1.2.772
TM1637 - Segment Display
TM1637 is a segments display with 6 characters Led controler. It uses a 2 wire implementation, one for the clock (CLK), one for the data (DIO). This chip can act as well as a key reader. This part has not been implemented. Only the Led display has been implemented. Most of its modern usages are for 4 to 6 segment displays.
Documentation
- TM1637 datasheet
Device family
You can find this display as Grove elements as well as very cheap with no brand. A search on your favorite online shop will give you lots of options. Those simple displays are used a lot for simple clock for example.
Testing was performed with a HiLetgo part.
Usage
You need to create a Tm1637
class with 2 pins, the clock one and the data one.
Tm1637 tm1637 = new Tm1637(4, 0);
Screen on, off, brightness
It is possible and you have to turn the screen on when you want to use the Tm1637.
tm1637.Brightness = 7;
tm1637.ScreenOn = true;
tm1637.ClearDisplay();
As an example, this will blink the screen:
for (int i = 0; i < 10; i++)
{
tm1637.ScreenOn = !tm1637.ScreenOn;
tm1637.Display(rawData);
Thread.Sleep(500);
}
When adjusting the screen brightness from 0 to 7 where 7 is the maximum, the command is immediate.
You can clear the display as well:
tm1637.ClearDisplay();
Displaying pre build characters
Characters are prebuild from 0 to F to facilitate hexadecimal displays on the segments. The following example will display the number 4 then 2 with a dot then A and F.
Character[] toDisplay = new Character[4] {
Character.Digit4,
Character.Digit2 | Character.Dot,
Character.Digit3,
Character.Digit8
};
tm1637.Display(toDisplay);
The maximum size of the buffer is 6.
Displaying raw data
You can as well display raw data like in the following example:
// Displays couple of raw data
Character[] rawData = new Character[6] {
// All led on including the dot
(Character)0b1111_1111,
// All led off
(Character)0b0000_0000,
// top blanck, right on, turning like this including dot
(Character)0b1010_1010,
// top on, right black, turning like this no dot
(Character)0b0101_0101,
// half one half off
Character.SegmentTop | Character.SegmentTopRight | Character.SegmentBottomRight | Character.SegmentBottom,
// half off half on
Character.SegmentTopLeft|Character.SegmentBottomLeft|Character.SegmentMiddle | Character.Dot,
};
// If you have a 4 display, only the first 4 will be displayed
// on a 6 segment one, all 6 will be displayed
tm1637.Display(rawData);
The maximum size of the buffer is 6.
Segment order
You can change the order of the characters. In some cases, especially when you have displays with 6 segments split with 2 displays of 3, the order may not be the one you expect.
tm1637.CharacterOrder = new byte[] { 2, 1, 0, 5, 4, 3 };
Make sure you have a length of 6 and all numbers from 0 to 5.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net is compatible. |
-
- nanoFramework.CoreLibrary (>= 1.16.11)
- nanoFramework.Runtime.Events (>= 1.11.29)
- nanoFramework.Runtime.Native (>= 1.7.8)
- nanoFramework.System.Device.Gpio (>= 1.1.53)
- Nerdbank.GitVersioning (>= 3.7.115)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.2.772 | 79 | 2/4/2025 |
1.2.755 | 74 | 1/31/2025 |
1.2.737 | 65 | 1/13/2025 |
1.2.696 | 99 | 12/16/2024 |
1.2.673 | 104 | 10/23/2024 |
1.2.662 | 100 | 10/11/2024 |
1.2.631 | 109 | 8/28/2024 |
1.2.570 | 107 | 6/14/2024 |
1.2.560 | 101 | 5/29/2024 |
1.2.548 | 101 | 5/15/2024 |
1.2.436 | 455 | 11/10/2023 |
1.2.329 | 512 | 5/26/2023 |
1.2.313 | 461 | 5/12/2023 |
1.2.297 | 487 | 5/3/2023 |
1.2.275 | 582 | 3/21/2023 |
1.2.203 | 629 | 12/28/2022 |
1.2.159 | 716 | 11/14/2022 |
1.2.153 | 683 | 11/5/2022 |
1.2.141 | 781 | 10/25/2022 |
1.2.122 | 826 | 10/12/2022 |
1.2.114 | 707 | 10/8/2022 |
1.2.95 | 799 | 9/22/2022 |
1.2.87 | 874 | 9/15/2022 |
1.2.73 | 731 | 9/8/2022 |
1.1.118.19693 | 836 | 6/24/2022 |
1.1.116.8772 | 772 | 6/24/2022 |
1.1.58.10097 | 848 | 5/23/2022 |
1.1.3 | 792 | 4/15/2022 |
1.1.1 | 793 | 4/14/2022 |
1.0.277-preview.126 | 136 | 3/25/2022 |
1.0.277-preview.125 | 127 | 3/25/2022 |
1.0.277-preview.112 | 122 | 3/19/2022 |
1.0.277-preview.54 | 144 | 1/31/2022 |
1.0.277-preview.34 | 128 | 1/27/2022 |
1.0.277-preview.32 | 136 | 1/27/2022 |
1.0.277-preview.30 | 134 | 1/27/2022 |
1.0.277-preview.15 | 135 | 1/21/2022 |
1.0.277-preview.1 | 139 | 1/11/2022 |
1.0.260 | 614 | 12/10/2021 |
1.0.259 | 627 | 12/9/2021 |
1.0.217 | 716 | 10/16/2021 |
1.0.215 | 683 | 10/15/2021 |