Components Needed:
Arduino Nano
TM1637 4-digit 7-segment display module
Jumper wires
Breadboard (optional)
Wiring:
Connect the TM1637 display module to the Arduino Nano as follows:
VCC to 5V on the Arduino Nano
GND to GND on the Arduino Nano
DIO to D2 on the Arduino Nano (can be changed if necessary)
CLK to D3 on the Arduino Nano (can be changed if necessary)
Arduino Code:
First, you'll need to install the TM1637 library. You can do this via the Arduino IDE Library Manager (Sketch - Include Library - Manage Libraries... and then search for "TM1637".
Libraries and Definitions: The TM1637Display library is included, and the pins for CLK and DIO are defined.
Initialization: The display is initialized in the setup function, and the brightness is set.
Countdown Logic: The loop function calculates the remaining minutes and seconds, displays the countdown time, and then decrements the countdown timer every second.
Stopping at Zero: If the countdown reaches zero, it stops.
Codes: [ Ссылка ]
Ещё видео!