#include "TM1637.h"
#define CLK 5//pins definitions for TM1637 and can be changed to other ports       
#define DIO 6
TM1637 tm1637(CLK, DIO);
void setup()
{
  tm1637.init();
  tm1637.set(BRIGHTEST);//BRIGHT_TYPICAL = 2,BRIGHT_DARKEST = 0,BRIGHTEST = 7;
}
void loop() {
  int val;
  val = analogRead(0);
  Display1(val);
  delay(200);
}
void Display1(int dat) {
  tm1637.display(0, dat / 1000);
  tm1637.display(1, dat / 100 % 10);
  tm1637.display(2, dat / 10 % 10);
  tm1637.display(3, dat % 10);
}

