// TM1637 SevenSegment Counter Wokwi Example
//
// https://wokwi.com/projects/339227323398095442
#include <TM1637.h>
const int CLK = 2;
const int DIO = 3;
TM1637 tm(CLK, DIO);
void setup() {
tm.init();
tm.set(BRIGHT_TYPICAL);
pinMode(LED_BUILTIN, OUTPUT);
}
unsigned int countdown = 100;
void loop() {
tm.display(0, (countdown / 10000) % 10);
tm.display(1, (countdown / 1000) % 10);
tm.display(2, (countdown / 100) % 10);
tm.display(3, (countdown / 10) % 10);
countdown--;
if (countdown == 0) {
digitalWrite(LED_BUILTIN, HIGH);
delay(5000);
countdown = 100;
digitalWrite(LED_BUILTIN, LOW);
}
delay(100);
}