#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>

MD_Parola display = MD_Parola(MD_MAX72XX::PAROLA_HW, 10, 8);
#define buton1 7
#define buton2 6
int b1 = 0;
void setup() 
{
  display.begin();
  display.displayClear();
  pinMode(buton1, INPUT);
  pinMode(buton2, INPUT);
  display.displayText("MD Moradul Siddique, CSE, JUST", PA_LEFT, 50, 0, PA_SCROLL_LEFT, PA_SCROLL_LEFT);
}
 
void loop() {
  if (digitalRead(buton1) == HIGH) {
    delay(250);
    b1 = 1;
    display.displayShutdown(false);
  }
  if (digitalRead(buton2) == HIGH) {
    delay(250);
    b1 = 0;
    display.displayClear();
    display.displayReset();
    display.displayShutdown(true);
  }
  if (b1 == 1){
    if (display.displayAnimate()) {
      display.displayReset();
    }
  }
}