Untitled
unknown
plain_text
2 years ago
674 B
7
Indexable
#include <MD_Parola.h>
#include <MD_MAX72XX.h>
#include <SPI.h>
#define MAX_DEVICES 4
#define CS_PIN 10
MD_Parola myDisplay = MD_Parola(MD_MAX72XX::FC16_HW, CS_PIN, MAX_DEVICES);
int hallSensorPin = 2;
void setup() {
myDisplay.begin();
myDisplay.setIntensity(8);
myDisplay.displayClear();
pinMode(hallSensorPin, INPUT);
}
void loop() {
int sensorValue = digitalRead(hallSensorPin);
if (sensorValue == HIGH) {
myDisplay.displayScroll("STOP STOP STOP STOP STOP STOP STOP", PA_CENTER, PA_SCROLL_LEFT, 30);
} else {
myDisplay.displayClear();
}
if (myDisplay.displayAnimate()) {
myDisplay.displayReset();
}
}Editor is loading...
Leave a Comment