I'm building a display with 8x8 LED matrix . I used this code and it worked well:
However , I would like to insert the text via serial and repeating this. In the code snippet below you can see that it shows the display text from the serial, but only once.
I could not , because of the different types of variables, put the contents of Serial.read to a string variable.
...
char string1[] = " Test text ";
char serialstring [] = ""; ----> here I should initialize a variable, empty, same type of string1.
void setup(){
m.init();
m.setIntensity(0);
Serial.begin(9600);
}
void loop(){
// this is the code if you want to entering a message via serial console
while (Serial.available() > 0){
byte c = Serial.read();
serialstring = serialstring + c ----> Here concatenate the value of c, converted to char or string (not too sure)
Serial.println(c, DEC);
printCharWithShift(c, 100);
}
delay(100);
m.shiftLeft(false, true);
// print the active sentences
printStringWithShift(string1, 100);
printStringWithShift(serialstring, 100); ----> here show variable content in display
}
Indicated in the code my idea but do not know how to do it. How can I do this?
Regards!