#include <TM1637Display.h>
const int CLK = 8; //Set the CLK pin connection to the display
const int DIO = 9; //Set the DIO pin connection to the display
uint8_t blank[] = {0x00, 0x00, 0x00,0x00}; // store the initial input
uint8_t ring[] = {0x06, 0x3f, 0x3f,0x3f}; // the numbers represents the values 1, 0, 0, 0
uint8_t dumy[] = {0x3f, 0x3f, 0x3f, 0x3f};
TM1637Display display(CLK, DIO); //set up the 4-Digit Display.
int i = 0;
void setup(){
display.setBrightness(7); //set the diplay to maximum brightness
display.setSegments(blank);//display the initial value
}
void loop(){
display.setSegments(ring);
delay(1000);
for(i=0;i<3;i++){
ring_counter();
}
}
void ring_counter(){
for (i=0;i<4;i++){
dumy[i]=ring[(i+3)%4];
}
display.setSegments(dumy);
delay(1000);
for(i=0;i<4;i++){
ring[i]=dumy[i];
}
}