Using TM1637 4 digits 7-Segment Display for Arduino

Project Video
Project Details

This video shows you how to use TM1637 4 digit 7-segment display module for arduino.

Project Code


/*
 * This is the Arduino code for TM1637 4 digits display.
 *  * 
 * Written by Ahmad Shamshiri. for Robojax Video
 * Date: Dec 06, 2017, in Ajax, Ontario, Canada
 * Permission granted to share this code given that this
 * note is kept with the code.
 * Disclaimer: this code is "AS IS" and for educational purpose only.
 * 
 */

/*
 * Original code from https://github.com/avishorp/TM1637
 * Modified for Robojax video on Dec 06, 2017

 */
#include 
#include 

// Module connection pins (Digital Pins)
#define CLK 2
#define DIO 3

// The amount of time (in milliseconds) between tests
#define TEST_DELAY   2000


TM1637Display display(CLK, DIO);

void setup()
{
}

void loop()
{


  display.setBrightness(0x0f);

  uint8_t data[] = { 0x0, 0x0, 0x0, 0x0 };
  display.setSegments(data);
  display.showNumberDec(23, false, 2,1);
  delay(TEST_DELAY);
  
  display.setSegments(data);
  display.showNumberDec(153, false, 3, 1);
  delay(TEST_DELAY);

  display.setSegments(data);
  for(int i=0; i<=500; i++)
  {
    display.showNumberDec(i);
  }

}

If you found this Arduino course helpful, please support me so I can continue creating content like this. support me via PayPal