#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <Wire.h>
#define HARDWARE_TYPE MD_MAX72XX::PAROLA_HW//1088AS HARDWARE
#define MAX_DEVICES 4
#define CS_PIN 5
#define BUF_SIZE 512
MD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
void setup()
{
Serial.begin(9600);
myDisplay.begin();
myDisplay.setIntensity(12);
myDisplay.displayClear();
pinMode(2, INPUT);
}
void loop()
{
int pot = analogRead(2);
char potStr[BUF_SIZE];
snprintf(potStr, BUF_SIZE, "%d", pot);
if (myDisplay.displayAnimate())
{
myDisplay.displayText(potStr, PA_CENTER, 10, 10, PA_SCROLL_LEFT, PA_SCROLL_LEFT);
}
}