Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

Scrolling Text with Arduino

Importance and Utility of Scrolling Text

Scrolling text is a popular feature in electronic displays, such as LED matrix panels, LCD screens, and scrolling message boards. It allows users to display dynamic and eye-catching messages or information. Scrolling text is commonly used in various applications, including public transportation signs, advertising boards, information displays, and even DIY projects.

The ability to display scrolling text using Arduino opens up a world of possibilities for creative projects. Whether you want to build a personalized name badge, a digital sign for your business, or a scrolling message board for fun, understanding how to implement scrolling text with Arduino is a valuable skill for any electronics enthusiast.

Project: Creating a Scrolling Text Display

In this example project, we will create a scrolling text display using an Arduino board and an LED matrix panel. The objective is to create a simple yet effective scrolling text display that can be easily customized and controlled.

The functionality of the project includes:

  1. Displaying scrolling text on an LED matrix panel.
  2. Controlling the speed and direction of the scrolling text.
  3. Allowing the user to input custom text to be displayed.

List of Components:

  1. Arduino Uno or compatible board x1
  2. LED matrix panel (e.g., 8x8 or 16x16) x1
  3. Jumper wires
  4. Breadboard (optional, for prototyping)
  5. Power supply for the LED matrix panel (if required)

Examples: Example 1: Scrolling Text Display

#include <Adafruit_GFX.h>
#include <Adafruit_LEDBackpack.h>

Adafruit_8x8matrix matrix = Adafruit_8x8matrix();

void setup() {
  matrix.begin(0x70);  // Address of the LED matrix panel
  matrix.setBrightness(5);  // Set brightness level (0-15)
}

void loop() {
  matrix.clear();  // Clear the display

  // Set the text to be displayed
  matrix.setTextSize(1);
  matrix.setTextColor(LED_ON);
  matrix.setCursor(0, 0);
  matrix.print("Hello, World!");

  // Scroll the text from right to left
  for (int8_t x = 8; x >= -((int8_t)matrix.width() + 1) * 6; x--) {
    matrix.clear();
    matrix.setCursor(x, 0);
    matrix.print("Hello, World!");
    matrix.writeDisplay();
    delay(100);  // Adjust scrolling speed
  }
}

Example 2: Customizable Scrolling Text

#include <Adafruit_GFX.h>
#include <Adafruit_LEDBackpack.h>

Adafruit_8x8matrix matrix = Adafruit_8x8matrix();

void setup() {
  matrix.begin(0x70);  // Address of the LED matrix panel
  matrix.setBrightness(5);  // Set brightness level (0-15)
}

void loop() {
  matrix.clear();  // Clear the display

  // Prompt the user for input
  matrix.setTextSize(1);
  matrix.setTextColor(LED_ON);
  matrix.setCursor(0, 0);
  matrix.print("Enter text:");
  matrix.writeDisplay();

  // Wait for user input
  while (!Serial.available()) {
    delay(100);
  }

  // Read the user input
  String input = Serial.readString();

  // Scroll the user input
  for (int8_t x = 8; x >= -((int8_t)matrix.width() + 1) * 6; x--) {
    matrix.clear();
    matrix.setCursor(x, 0);
    matrix.print(input);
    matrix.writeDisplay();
    delay(100);  // Adjust scrolling speed
  }
}

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.