#include <MD_MAX72xx.h>


const uint32_t CS_PIN = D10;
const uint8_t NB_MAX7219 = 4; // nombre d'afficheur(s) juxtaposé(s)
MD_MAX72XX afficheurs( MD_MAX72XX::PAROLA_HW, CS_PIN, 4);


void setup()
{
  afficheurs.begin();

}


void loop() {
  static uint32_t tpre = millis();
  uint32_t tacc = millis();

  static int16_t loca = 7;

  if (tpre - tacc >= 100) {
    afficheurs.clear();

    afficheurs.setChar(loca, 'E');
    afficheurs.setChar(loca + 8, 'B');
    afficheurs.setChar(loca + 16, 'D');
    afficheurs.setChar(loca + 24, 'O');

    
    if (loca == 39) loca = -25;
    else loca++;

    afficheurs.update();

    tpre = tacc;
  }
  // put your main code here, to run repeatedly:
  delay(100); // this speeds up the simulation
}