====== lamaPLC: TM1637 7-segment display ====== {{ :sensor:tm1637_2.png?200|TM1637 7-segment display}} The TM1637 module is a driver for 4-digit 7-segment displays. These chips are standard in inexpensive display units. They communicate with the processor using an **I²C-like protocol**. The implementation relies entirely on software emulation and uses no specialized hardware, aside from GPIO pins. It is assumed that pull-up resistors are present, typically integrated into the display module. * Operating voltage: 3.3 – 5 V DC * Maximum current draw: 80mA * Reverse polarity protection: Yes ==== Wiring Diagram ===== ^TM1637 Pin^Arduino^Pin Description| ^GND|GND|Ground| ^VCC|5V or 3.3V Power|(3.3V–5.25V DC)| ^DIO|Digital Pin 3|Data Input/Output (configurable)| ^CLK|Digital Pin 2|Clock Input (configurable)| {{page>:tarhal}} ==== Required Library ==== Install the **TM1637Display** library by Avishay Orpaz through the Arduino IDE Library Manager (Sketch > Include Library > Manage Libraries...) ==== Arduino code ==== This code initializes the display, sets the brightness, and loops through a simple counter. #include // Define the connections #define CLK 2 #define DIO 3 // Create a display object TM1637Display display(CLK, DIO); void setup() { display.setBrightness(0x0f); // Set brightness (0x00 to 0x0f) display.clear(); // Clear the display } void loop() { // Show a static number display.showNumberDec(1234); delay(2000); // Counter loop for (int i = 0; i <= 100; i++) { display.showNumberDec(i); delay(100); } display.clear(); delay(1000); } ===== Sources ===== [[https://docs.arduino.cc/libraries/tm1637/|Arduino Doc TM1637 library]] \\ ===== Sensor topics on lamaPLC ===== {{topic>sensor}} \\ \\ {{tag>i2c 7-segment_display display TM1637 Arduino }} \\ This page has been accessed for: Today: {{counter|today}}, Until now: {{counter|total}}