#include <TM1637.h>
const int CLK = 33;
const int DIO = 25;
int value = 0;
TM1637 tm(CLK, DIO);
void display(unsigned int adcval) {
tm.display(0, (adcval / 1000) % 10);
tm.display(1, (adcval / 100) % 10);
tm.display(2, (adcval / 10) % 10);
tm.display(3, adcval % 10);
}
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(34, INPUT);
tm.init();
tm.set(BRIGHT_TYPICAL);
Serial.println("Hello, ESP32!");
}
void loop() {
// put your main code here, to run repeatedly:
int value = analogRead(34);
display(unsigned int adcval);
delay(10); // this speeds up the simulation
}
// TM1637 SevenSegment Counter Wokwi Example
//
// https://wokwi.com/projects/339227323398095442