// Is the TM1637_RT library compatible with a ESP32?
// Answer: Yes
//
// Library: "TM1637_RT", https://github.com/RobTillaart/TM1637_RT
#include <TM1637.h>
TM1637 TM;
unsigned long previousMillis;
const unsigned long interval = 1000UL;
unsigned int count;
void setup()
{
TM.begin(16, 15, 4); // clockpin, datapin, #digits
TM.displayClear();
TM.setBrightness(7); // full brightness, default is 3
}
void loop()
{
unsigned long currentMillis = millis();
if( currentMillis - previousMillis >= interval)
{
previousMillis += interval; // for a clock-accurate millis timer
TM.displayInt(count); // display the count value
count++;
}
delay(10); // speed up simulation, does not influence millis
}