#include <TM1637Display.h>
#define CLK 9
#define DIO 10
TM1637Display display = TM1637Display(CLK, DIO);
const uint8_t celsius[] = {
SEG_A | SEG_B | SEG_F | SEG_G, // Degree symbol
SEG_A | SEG_D | SEG_E | SEG_F // C
};
void setup() {
display.clear();
display.setBrightness(7); // set the brightness to 7 (0:dimmest, 7:brightest)
}
void loop() {
// show counter 0-9
int i;
for (i = 0; i < 10; i++) {
display.showNumberDec(i);
delay(500);
display.clear();
}
display.showNumberDec(-91); // displayed _-91
delay(2000);
display.clear();
int temperature = 23; // or read from temperature sensor
display.showNumberDec(temperature, false, 2, 0);
display.setSegments(celsius, 2, 2);
delay(2000);
display.clear();
}