Ryan Chan
Published © GPL3+

TM1637 Digit Display - Arduino Quick Tutorial

Learn how to quickly use the TM1637 Digit Display!

BeginnerProtip30 minutes72,190
TM1637 Digit Display - Arduino Quick Tutorial

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
Any Arduino should work
×1
TM1637 Digit Display
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Diagram

Code

Example Code

C/C++
#include <TM1637.h>

int CLK = 2;
int DIO = 3;

TM1637 tm(CLK,DIO);

void setup() {
  // put your setup code here, to run once:
  tm.init();

  //set brightness; 0-7
  tm.set(2);
}

void loop() {
  // put your main code here, to run repeatedly:

  // example: "12:ab"
  // tm.display(position, character);
  tm.display(0,1);
  tm.display(1,2);
  tm.point(1);
  tm.display(2,10);
  tm.display(3,11);

  delay(1000);

  // example: "1234"
  displayNumber(1234);

  delay(1000);
}

void displayNumber(int num){   
    tm.display(3, num % 10);   
    tm.display(2, num / 10 % 10);   
    tm.display(1, num / 100 % 10);   
    tm.display(0, num / 1000 % 10);
}

Credits

Ryan Chan

Ryan Chan

9 projects • 231 followers
I like turtles. I also like robots.

Comments