Notifications
Clear all

[Solved] MAX7219 8-Digit Display with Arduino Nano

3 Posts
3 Users
0 Reactions
240 Views
Farah Haddad
(@fhaddad)
Member
Joined: 4 years ago
Posts: 32
Topic starter  

Hi Forum,

In the article "LED Display with Arduino," Bill discussed how we can also use the MAX7219 LED matrix to scroll the text, Bill used the below code. My question is that the line of code used to display the message "Welcome to the Workshop!" is inside the void setup() section. How can I move it to the void loop() section? 

 

/*
  Matrix Display Scrolling Demo
  matrix-scroll-demo.ino
  Scrolls text on a 4-element 8x8 LED matrix display
 
  DroneBot Workshop 2022
   https://dronebotworkshop.com 
*/
 
// Include the required libraries
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
 
// Specify display hardware type
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
//#define HARDWARE_TYPE MD_MAX72XX::GENERIC_HW
 
// Display Size and CS Pin
#define MAX_DEVICES 4
#define CS_PIN 10
 
// Create a display object
MD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
 
void setup() {
 
  // Intialize the display object
  myDisplay.begin();
 
  // Set the intensity (brightness) of the display (0-15)
  myDisplay.setIntensity(5);
 
  // Clear the display
  myDisplay.displayClear();
 
  // Display our text in a scroll
  myDisplay.displayScroll("Welcome to the Workshop!", PA_CENTER, PA_SCROLL_LEFT, 100);
}
 
void loop() {
 
  // Ensure display stays animated
  if (myDisplay.displayAnimate()) {
    myDisplay.displayReset();
  }
}

   
Quote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2544
 

@fhaddad

Have you tried just physically moving the command into the loop ?

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7195
 

@fhaddad Ctl-X Ctl-V

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote