#include <TM1637Display.h>
#include <RTClib.h>
RTC_DS1307 rtc;
#define CLK 2
#define DIO 3
#define DIO2 5
#define CLK2 4
#define DIO3 7
#define CLK3 6
TM1637Display display2(CLK2, DIO2);
TM1637Display display(CLK, DIO);
TM1637Display display3(CLK3, DIO3);
bool check=false;
void setup()
{
Wire.begin();
rtc.begin();
Serial.begin(115200);
// rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
display.setBrightness(4);
display2.setBrightness(4);
display3.setBrightness(4);
}
void loop()
{
display.showNumberDecEx(((millis()/60000)*100) + ((millis()/1000)% 60),0x40, true,4,0);
if(99 - millis()/1000 > 0 && check==false) {
display2.showNumberDecEx(9900- millis()/10,0x40, true, 4, 0);
// display2.showNumberDecEx(99-(millis()%1000)/10, 0b01000000,true, 2,2);
}
else if(99-millis()/1000 ==0){
display2.showNumberDecEx(0,0b01000000,true,4,0);
check=true;
}
display3.showNumberDecEx(int(rtc.now().hour()), 0b11100000, true, 2, 0);
display3.showNumberDecEx(int(rtc.now().minute()), 0b11100000, true, 2, 2);
}
// display.showNumberDecEx((millis()/1000) % 60, 0b01000000, true, 2, 2);
// display.showNumberDecEx(millis()/60000, 0b01000000, true, 2, 0);
// if(99 - millis()/1000 > 0 && check==false) {
// display2.showNumberDecEx(99-millis()/ 1000,0b01000000, true, 2, 0);
// display2.showNumberDecEx(100-(millis()%1000)/10, 0b01000000,true, 2,2);}
// else if(99-millis()/1000 ==0){
// display2.showNumberDecEx(0,0b01000000,true,4,0);
// check=true;
// }
// display3.showNumberDecEx(int(rtc.now().hour()), 0b11100000, true, 2, 0);
// display3.showNumberDecEx(int(rtc.now().minute()), 0b11100000, true, 2, 2);