Help with Parola and push button Project

Ive been working on this for hours and cannot get it figured out. have a 8x64 matrix and 4 buttons. each button is connected to ground, and pins 9, 8, and 7. I want to be able to press a button and have a message scroll across the matrix when I press a button. I also want to be able to press a different button and have the previous message stop and start the new message. heres my code so far, as I do not have much experience in coding and dont know where to go from here.



#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4
#define CS_PIN 3
MD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
const int buttonPin1 =  9;
const int buttonPin2 =  8;
const int buttonPin3 =  7;
int buttonState = 0;

void setup() {
  
  myDisplay.begin();
    
      myDisplay.setIntensity(0);
      
  myDisplay.displayClear();

   pinMode(buttonPin1, INPUT);
   myDisplay.displayText("Scrolling text", PA_CENTER, 45, 0, PA_SCROLL_LEFT, PA_SCROLL_LEFT);
}

void loop() {
 
 buttonState = digitalRead(buttonPin1);
myDisplay.displayAnimate();
 
   if (buttonState == HIGH) {
    myDisplay.displayText("Scrolling text", PA_CENTER, 45, 0, PA_SCROLL_LEFT, PA_SCROLL_LEFT);

  }
  
    
}

Hello
To handle several buttons you may design a button manager.
Have a nice day and enjoy coding in C++.

So firstly it would be sensible to connect the buttons from each data pin to ground and set each pinMode to INPUT_PULLUP. How have you presently connected them?

So what does your program do so far? Does it actually scroll a message?

Hi,

How have you got 4 buttons connected?
Can you please post a circuit diagram?
A hand drawn image would be fine, but please show power supply, gnds, component names and pin labels.

Thanks.. Tom... :grinning: :+1: :coffee: :australia: