#include "GyverTM1637.h"
#define CLK 6
#define DIO 7
#define sw A0
#define sw1 A1
int swt = 0;
int reading0, reading1, time_s;

GyverTM1637 disp(CLK, DIO);


void setup() {
  disp.clear();
  disp.brightness(7);
  pinMode(sw, INPUT);
  pinMode(sw1, INPUT);
}


void loop() {
  if (digitalRead(sw) == 1) {
    delay(50);
    if (swt == 0){
      swt = 1;
    } else {
      swt = 0;
    }
  }

  if (digitalRead(sw1) == 1) {
    delay(50);
    time_s = 0;
    swt = 0;
    disp.clear();
    disp.displayInt(time_s);
  }

  if (swt == 1){
    delay(1000);
      time_s += 1;
    disp.displayInt(time_s);
  }
}
4-Digit Display