#include <TM1637.h>
#include "RTClib.h"
RTC_DS1307 rtc;
int sensorPin = 13;
int peopleCount = 0;
const int CLK = 2;
const int DIO = 3;
TM1637 tm(CLK, DIO);
void setup() {
pinMode(sensorPin, INPUT);
Serial.begin(9600);
tm.init();
tm.set(BRIGHT_TYPICAL);
}
int prev_state = 0;
void readPIR() {
int sensorValue = digitalRead(sensorPin);
if (sensorValue == HIGH && prev_state == LOW) {
Serial.println(peopleCount);
peopleCount++;
}
prev_state = sensorValue;
}
void showNumber() {
DateTime now = rtc.now();
tm.display(0, (now.hour / 10) % 10);
tm.display(1, now.hour % 10);
tm.display(2, (now.minute / 10) % 10);
tm.display(3, now.minute % 10);
}
void current_time() {
tm.display
}
void loop() {
// readPIR();
// showNumber();
current_time();
delay(100);
}