De TM1637 4-cijferige display is een klein seven-segment LED-module om numerieke waarden en eenvoudige symbolen weer te geven. Het gebruikt een 2-draads TM1637 seriële interface met CLK en DIO, plus VCC en GND voor de voeding.
| Pin | Signaal | Beschrijving |
|---|---|---|
CLK |
clock | TM1637 serial clock input from the microcontroller. |
DIO |
data | Bidirectional TM1637 serial data line to the microcontroller. |
GND |
ground | Ground reference for power and logic signals. |
VCC |
power | Positive supply for the display module, typically 3.3V or 5V. |
| Van | Naar | Draad |
|---|---|---|
board:D2 |
x1:CLK |
green |
board:D3 |
x1:DIO |
blue |
board:5V |
x1:VCC |
red |
board:GND |
x1:GND |
black |
Dit voorbeeld is geschreven en compile-gecheckt voor de arduino-uno. Codey Online past het voor je aan naar elk ander ondersteund board.
#include <TM1637Display.h>
const int CLK_PIN = 2;
const int DIO_PIN = 3;
TM1637Display display(CLK_PIN, DIO_PIN);
void setup() {
Serial.begin(9600);
display.setBrightness(7); // 0 to 7
display.clear();
Serial.println("TM1637 4-digit display example");
Serial.println("Showing a counter on the display.");
}
void loop() {
static unsigned int counter = 0;
display.showNumberDec(counter, false); // no leading zeros
Serial.print("Counter: ");
Serial.println(counter);
counter++;
if (counter > 9999) {
counter = 0;
}
delay(1000);
}
Beschrijf wat je wilt bouwen. Codey Online schrijft de code, tekent het aansluitschema, compileert het en flasht je board rechtstreeks vanuit de browser.
Gratis starten