Hi,
I a using an Arduino Uno R3 with a connected HC-05 bluetooth module and smartphone app to send a message to be displayed / scrolling on a 8 x 32 ICSTATION type dot matrix modue.
All physical component connections are o.k. and I can see that the data is received and the replies to the Serial Monitor / smartphone indicate all is well.
I have also tested the ICSTATION dot matrix module and it correctly scrolls text (see commented out line in the undernoted code).
What should be a relatively easy problem has me totally stumped - the fault must lie in the use of (cws.c_str() - but I confess I cannot understand why or how to correct it.
Any help would be greatly appreciated!
Chas
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#define HARDWARE_TYPE MD_MAX72XX::ICSTATION_HW
#define MAX_DEVICES 4
#define CS_PIN 10
// Create a new instance of the MD_Parola class with hardware SPI connection
MD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
void setup() {
Serial.begin(9600);
myDisplay.begin();
myDisplay.setIntensity(0);
myDisplay.displayClear();
}
void loop() {
if (Serial.available()) { // if there is data coming
String cws = Serial.readStringUntil('\n'); // read string until meet newline character
myDisplay.displayClear(); // clear led matrix display
myDisplay.displayScroll(cws.c_str(), PA_CENTER, PA_SCROLL_LEFT, 100);
//myDisplay.displayScroll("Working fine!", PA_CENTER, PA_SCROLL_LEFT, 100);
Serial.print("LED Matrix displayed: "); // reports action to smartphone app
Serial.println(cws);
}
if (myDisplay.displayAnimate()) {
myDisplay.displayReset();
}
}