กลับไปหน้ารวมไฟล์
4-digit-text-scroller-en.md

Array Shifting: 4-Digit Text Scroller

A TM1637 4-digit display is designed to show "10:45". Forcing an 8-letter word like "HELLO YOU" to scroll across those 4 character limits is a masterclass in code iteration. The 4 Digit Display Text Scroller behaves like a miniature Times Square ticker tape!

7segment_4digit_led_macro_1772681954421.png

Custom Hexadecimal Characters

A 7-segment display isn't a high-res screen; you have to draw characters using math.

  1. To make an "H", you turn on segments B, C, E, F, and G. In binary, this is 0b01110110 (or 0x76 in Hex).
  2. You create an array for the entire sentence: uint8_t textArray[] = {0x76(H), 0x79(E), 0x38(L), 0x38(L), 0x3F(O)...};

The Shifting Magic (The Buffer)

You only have 4 physical screens.

  1. Frame 1: The display shows slots 0, 1, 2, 3 (H E L L).
  2. The Wait: A delay(500) makes it readable.
  3. The Increment: A for loop variable shifts everything over by one.
  4. Frame 2: The display now shows slots 1, 2, 3, 4 (E L L O).
  5. Frame 3: L L O [space]. By continually shifting the "window" of the array we are looking at to the right, the eye sees a continuous, smooth scrolling animation across the limited hardware.

Parts Needed

  • Arduino Uno/Nano.
  • TM1637 or YSD-439AK2B 4-Digit 7-Segment Display Module: Ensure it is the module with the built-in backpack chip, not just a bare display which requires 12 massive jumper wires!
  • A Breadboard.

ข้อมูล Frontmatter ดั้งเดิม

title: "4 Digit Display Text Scroller"
description: "Billboards in your bedroom! Master the complex timing and arrays required to smoothly scroll long words across a tiny 4-digit 7-segment display."
category: "Screens & Displays"
difficulty: "Advanced"