Wury NoviyantoMthamrfHendra KusumahTry Ahmad Hidayat Salim
Published

Scrolling Text Display with MAX7219 & Xiao ESP32-S3

A microcontroller project that shows dynamic scrolling text on an LED dot matrix using MAX7219 and Xiao ESP32-S3. Compact and fun!

BeginnerFull instructions provided5 hours389
Scrolling Text Display with MAX7219 & Xiao ESP32-S3

Things used in this project

Hardware components

Seeed Studio XIAO ESP32S3 Sense
Seeed Studio XIAO ESP32S3 Sense
×1
LED Dot Matrix Display, Red
LED Dot Matrix Display, Red
×1
Grove - 4 pin Male Jumper to Grove 4 pin Conversion Cable
Seeed Studio Grove - 4 pin Male Jumper to Grove 4 pin Conversion Cable
×1
USB Cable, USB Type C Plug
USB Cable, USB Type C Plug
×1

Software apps and online services

Arduino Web Editor
Arduino Web Editor

Story

Read more

Schematics

MAX7219 LED dot matrix display with Arduino Uno wiring diagram schematic pinout

This image shows the wiring diagram between the MAX7219 LED matrix display and Arduino. Use it as a guide for connecting VCC, GND, DIN, CS, and CLK pins. Although the diagram uses Arduino Uno, the same concept applies to ESP32 by adjusting the pin connections accordingly.

Code

TextRunningMAX7219.ino

Arduino
This Arduino sketch displays a scrolling text on a MAX7219 8x32 LED matrix using an ESP32 board. It uses the MD_Parola and MD_MAX72XX libraries for control. Upload this code using the Arduino IDE after connecting the display to the ESP32 as per the pin definitions.
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>

// Definisikan pin SPI yang digunakan
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4

#define CLK_PIN   13
#define DATA_PIN  11
#define CS_PIN    10

// Inisialisasi objek untuk modul dot matrix
MD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

// Teks yang akan ditampilkan
char text1[] = "Wury";

char text2[] = "Toha & Ahmad";

bool isFirstText = true;

void setup() {
  // Inisialisasi modul dot matrix
  myDisplay.begin();
  
  // Tampilkan tulisan pertama
  displayText(text1);
}

void loop() {
  // Perbarui tampilan modul dot matrix
  if (myDisplay.displayAnimate()) {
    myDisplay.displayReset();

    if (isFirstText) {
      // Ganti ke tulisan kedua setelah tulisan pertama selesai
      clearDisplay();
       delay(1000); 
      displayText(text2);
      isFirstText = false;
      
    } else {
      // Kembali ke tulisan pertama setelah tulisan kedua selesai
      clearDisplay();
       delay(1000); 
      displayText(text1);
      isFirstText = true;
  
    }
  }
}

void displayText(char* text) {
  // Tampilkan teks dengan efek scroll dari kiri ke kanan
  myDisplay.displayText(text, PA_LEFT, 200, 0, PA_SCROLL_LEFT);
 
}

void clearDisplay() {
  // Bersihkan tampilan pada modul dot matrix
  myDisplay.displayClear();
}

Credits

Wury Noviyanto
1 project • 0 followers
Mthamrf
1 project • 0 followers
Hendra Kusumah
49 projects • 159 followers
Love hacking and making new things from IoT to robotics
Try Ahmad Hidayat Salim
0 projects • 0 followers

Comments